diff --git a/application/modules/default/controllers/ExploreController.php b/application/modules/default/controllers/ExploreController.php
index a87ea8202..e7bee9b77 100644
--- a/application/modules/default/controllers/ExploreController.php
+++ b/application/modules/default/controllers/ExploreController.php
@@ -1,589 +1,596 @@
.
**/
class ExploreController extends Local_Controller_Action_DomainSwitch
{
const DEFAULT_ORDER = 'latest';
const TAG_ISORIGINAL = 'original-product';
/** @var string */
protected $_browserTitlePrepend;
public function init()
{
parent::init();
$this->_auth = Zend_Auth::getInstance();
}
public function categoriesAction()
{
// Filter-Parameter
$inputFilterParams['category'] = (int)$this->getParam('cat', null);
$inputFilterParams['filter'] = (int)$this->getParam('fil', null);
$inputFilterParams['order'] = preg_replace('/[^-a-zA-Z0-9_]/', '', $this->getParam('ord', self::DEFAULT_ORDER));
$inputFilterParams['selected'] = (int)$this->getParam('sel', $inputFilterParams['category']);
$modelCategories = new Default_Model_DbTable_ProjectCategory();
$children = $modelCategories->fetchImmediateChildren($inputFilterParams['selected']);
$selChild = $modelCategories->fetchElement($inputFilterParams['filter']);
$response = $this->generateResponseMsg($children, $inputFilterParams, $selChild);
$this->_helper->json($response);
}
private function generateResponseMsg($children, $inputParams, $selChild)
{
$result = array();
if (count($children) == 0) {
return $result;
}
$helperBuildExploreUrl = new Default_View_Helper_BuildExploreUrl();
foreach ($children as $child) {
$nodeSelectedState = ($inputParams['filter'] == $child['project_category_id']) ? true : false;
if (1 == ($child['rgt'] - $child['lft'])) {
$result[] = array(
'title' => $child['title'],
'key' => $child['project_category_id'],
'href' => $helperBuildExploreUrl->buildExploreUrl($inputParams['category'], $child['project_category_id'],
$inputParams['order']),
'target' => '_top',
'selected' => $nodeSelectedState
);
} else {
$nodeHasChildren = (1 == ($child['rgt'] - $child['lft'])) ? false : true;
$nodeIsSelectedSubCat = (($selChild['lft'] > $child['lft']) AND ($selChild['rgt'] < $child['rgt'])) ? true : false;
$nodeExpandedState = false;
$nodeChildren = null;
if ($nodeHasChildren AND $nodeIsSelectedSubCat) {
$nodeExpandedState = true;
$modelCategories = new Default_Model_DbTable_ProjectCategory();
$immChildren = $modelCategories->fetchImmediateChildren($child['project_category_id']);
$nodeChildren = $this->generateResponseMsg($immChildren, $inputParams, $selChild);
}
$result[] = array(
'title' => $child['title'],
'key' => $child['project_category_id'],
'folder' => true,
'lazy' => true,
'selected' => $nodeSelectedState,
'expanded' => $nodeExpandedState,
'href' => $helperBuildExploreUrl->buildExploreUrl($inputParams['category'], $child['project_category_id'],
$inputParams['order']),
'target' => '_top',
'children' => $nodeChildren
);
}
}
return $result;
}
/**
* @throws Zend_Cache_Exception
* @throws Zend_Db_Select_Exception
* @throws Zend_Exception
* @throws Zend_Loader_PluginLoader_Exception
* @throws Zend_Paginator_Exception
*/
public function indexAction()
{
// Filter-Parameter
/*$inputFilterOriginal = $this->getParam('filteroriginal', $this->getFilterOriginalFromCookie());
$this->storeFilterOriginalInCookie($inputFilterOriginal);
$this->view->inputFilterOriginal = $inputFilterOriginal;
*/
$isShowOnlyFavs = (int)$this->getParam('fav', 0);
$inputCatId = (int)$this->getParam('cat', null);
if ($inputCatId) {
// $this->view->isFilterCat = true;
// $this->view->filterCat = $inputCatId;
$this->view->catabout = $this->getCategoryAbout($inputCatId);
$helperFetchCategory = new Default_View_Helper_CatTitle();
$catTitle = $helperFetchCategory->catTitle($inputCatId);
//$this->view->headTitle($catTitle . ' - ' . $_SERVER['HTTP_HOST'], 'SET');
$this->view->headTitle($catTitle . ' - ' . $this->getHeadTitle(), 'SET');
}
$this->view->cat_id = $inputCatId;
$this->view->showAddProduct = 1;
$storeCatIds = Zend_Registry::isRegistered('store_category_list') ? Zend_Registry::get('store_category_list') : null;
$filter = array();
$filter['category'] = $inputCatId ? $inputCatId : $storeCatIds;
$filter['order'] = preg_replace('/[^-a-zA-Z0-9_]/', '', $this->getParam('ord', self::DEFAULT_ORDER));
// removed filter original 20191007
//$filter['original'] = $inputFilterOriginal == 1 ? self::TAG_ISORIGINAL : null;
if($isShowOnlyFavs == 1) {
if($this->_authMember->member_id)
{
$filter['favorite'] = $this->_authMember->member_id;
$this->view->authMember = $this->_authMember;
}else{
$this->redirect('/browse');
}
}else
{
$isShowOnlyFavs = 0;
}
$filter['tag'] = Zend_Registry::isRegistered('config_store_tags') ? Zend_Registry::get('config_store_tags') : null;
if (APPLICATION_ENV == "development") {
Zend_Registry::get('logger')->debug(__METHOD__ . ' - ' . json_encode($filter));
}
$tagFilter = Zend_Registry::isRegistered('config_store_tags') ? Zend_Registry::get('config_store_tags') : null;
$tagGroupFilter = Zend_Registry::isRegistered('config_store_taggroups') ? Zend_Registry::get('config_store_taggroups') : null;
if(!empty($tagGroupFilter)) {
$filterArray = array();
foreach ($tagGroupFilter as $tagGroupId) {
$inputFilter = $this->getFilterTagFromCookie($tagGroupId);
$filterArray[$tagGroupId] = $inputFilter;
if(!empty($inputFilter)) {
$filter['tag'][] = $inputFilter;
}
}
$this->view->tag_group_filter = $filterArray;
}
$storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null;
$page = (int)$this->getParam('page', 1);
$index = null;
$browseListType = null;
//Old: index as Param
$index = $this->getParam('index');
if($index) {
- if($index == 2) {
- $browseListType = 'picture';
- }
- if($index == 3) {
- $browseListType = 'music';
- }
- if($index == 4) {
- $browseListType = 'phone-pictures';
- }
-
+ switch ($index) {
+ case 2:
+ $browseListType = 'picture';
+ break;
+ case 3:
+ $browseListType = 'picture';
+ break;
+ case 4:
+ $browseListType = 'phone-pictures';
+ break;
+ case 8:
+ $browseListType = 'apps';
+ break;
+ case 9:
+ $browseListType = 'icons';
+ break;
+ }
}
if($storeConfig->browse_list_type) {
$listTypeTable = new Default_Model_DbTable_BrowseListType();
$listType = $listTypeTable->findBrowseListType($storeConfig->browse_list_type);
if(isset($listType)) {
$browseListType = $listType['name'];
$index = 2;
}
}
//Browse List config in Category set?
if(!$index) {
//Now the list type is in backend categories set
$tableCat = new Default_Model_DbTable_ProjectCategory();
$cat = $tableCat->findCategory($this->view->cat_id);
if(isset($cat) && isset($cat['browse_list_type'])) {
$indexListType = $cat['browse_list_type'];
$listTypeTable = new Default_Model_DbTable_BrowseListType();
$listType = $listTypeTable->findBrowseListType($indexListType);
if(isset($listType)) {
$browseListType = $listType['name'];
$index = 2;
}
}
}
// my favourite list filter & list layout
if($isShowOnlyFavs == 1) {
$index=7;
$browseListType = 'myfav';
}
if($index)
{
// only switch view via index=2 parameter
$pageLimit = 50;
if($index==7) $pageLimit = 10;
$requestedElements = $this->fetchRequestedElements($filter, $pageLimit, ($page - 1) * $pageLimit);
$this->view->productsJson = Zend_Json::encode($requestedElements['elements']);
$this->view->filtersJson = Zend_Json::encode($filter);
$this->view->cat_idJson = Zend_Json::encode($inputCatId);
$modelInfo = new Default_Model_Info();
$topprods = $modelInfo->getMostDownloaded(100, $inputCatId, $tagFilter);
$this->view->topprodsJson = Zend_Json::encode($topprods);
$comments = $modelInfo->getLatestComments(5, $inputCatId, $tagFilter);
$this->view->commentsJson = Zend_Json::encode($comments);
$modelCategory = new Default_Model_ProjectCategory();
$this->view->categoriesJson = Zend_Json::encode($modelCategory->fetchTreeForView());
$this->view->browseListType = $browseListType;
$this->view->pageLimit = $pageLimit;
/*
// temperately when index=3 return product files too... in the future could be replaced by category parameter.
if($index==3 || $browseListType == 'music')
{
$modelProject = new Default_Model_Project();
$files = $modelProject->fetchFilesForProjects($requestedElements['elements']);
$salt = PPLOAD_DOWNLOAD_SECRET;
foreach ($files as &$file) {
$timestamp = time() + 3600; // one hour valid
$hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying
$url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp;
if(null != $this->_authMember) {
$url .= '/u/' . $this->_authMember->member_id;
}
$url .= '/lt/filepreview/' . $file['name'];
$file['url'] = urlencode($url);
}
} else {
$modelProject = new Default_Model_Project();
$files = $modelProject->fetchFilesForProjects($requestedElements['elements']);
$salt = PPLOAD_DOWNLOAD_SECRET;
foreach ($files as &$file) {
$timestamp = time() + 3600; // one hour valid
$hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying
$url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp;
if(null != $this->_authMember) {
$url .= '/u/' . $this->_authMember->member_id;
}
$url .= '/lt/filepreview/' . $file['name'];
$file['url'] = urlencode($url);
}
}
*
*/
$this->_helper->viewRenderer('index-react'.$index);
}
else if ($storeConfig->layout_explore && $storeConfig->isRenderReact()) {
$pageLimit = 50;
$requestedElements = $this->fetchRequestedElements($filter, $pageLimit, ($page - 1) * $pageLimit);
$this->view->productsJson = Zend_Json::encode($requestedElements['elements']);
$this->view->filtersJson = Zend_Json::encode($filter);
$this->view->cat_idJson = Zend_Json::encode($inputCatId);
$modelInfo = new Default_Model_Info();
$topprods = $modelInfo->getMostDownloaded(100, $inputCatId, $tagFilter);
$this->view->topprodsJson = Zend_Json::encode($topprods);
$comments = $modelInfo->getLatestComments(5, $inputCatId, $tagFilter);
$this->view->commentsJson = Zend_Json::encode($comments);
$modelCategory = new Default_Model_ProjectCategory();
$this->view->categoriesJson = Zend_Json::encode($modelCategory->fetchTreeForView());
$this->_helper->viewRenderer('index-react');
$this->view->pageLimit = $pageLimit;
} else {
$pageLimit = 10;
$requestedElements = $this->fetchRequestedElements($filter, $pageLimit, ($page - 1) * $pageLimit);
$this->view->pageLimit = $pageLimit;
}
if($storeConfig) {
$this->view->storeabout = $this->getStoreAbout($storeConfig->store_id);
}
$paginator = Local_Paginator::factory($requestedElements['elements']);
$paginator->setItemCountPerPage($pageLimit);
$paginator->setCurrentPageNumber($page);
$paginator->setTotalItemCount($requestedElements['total_count']);
$this->view->products = $paginator;
$this->view->totalcount = $requestedElements['total_count'];
$this->view->filters = $filter;
$this->view->page = $page;
$this->view->package_type = Zend_Registry::isRegistered('config_store_tags') ? Zend_Registry::get('config_store_tags') : null;
$this->view->tags = $tagFilter;
}
/**
* @param $inputCatId
*
* @return string|null
* @throws Zend_Exception
*/
protected function getCategoryAbout($inputCatId)
{
$config = Zend_Registry::get('config');
$static_config = $config->settings->static;
$include_path_cat = $static_config->include_path . 'category_about/' . $inputCatId . '.phtml';
if (file_exists($include_path_cat)) {
return $include_path_cat;
}
return null;
}
/**
* @param array $inputFilterParams
* @param int $limit
* @param int $offset
*
* @return array
* @throws Zend_Cache_Exception
* @throws Zend_Db_Select_Exception
* @throws Zend_Exception
*/
private function fetchRequestedElements($inputFilterParams, $limit = null, $offset = null)
{
$modelProject = new Default_Model_Project();
$requestedElements = $modelProject->fetchProjectsByFilter($inputFilterParams, $limit, $offset);
return $requestedElements;
}
/**
* @throws Zend_Exception
* @throws Zend_Paginator_Exception
*/
public function searchAction()
{
ini_set('memory_limit', '3072M');
$allDomainCatIds = Zend_Registry::isRegistered('store_category_list') ? Zend_Registry::get('store_category_list') : null;
if (count($allDomainCatIds) == 0) {
$allDomainCatIds = null;
}
if (isset($allDomainCatIds)) {
$this->view->categories = $allDomainCatIds;
} else {
$modelCategories = new Default_Model_DbTable_ProjectCategory();
$this->view->categories = $modelCategories->fetchMainCatIdsOrdered();
}
// Filter-Parameter
$filterInput = new Zend_Filter_Input(array('*' => 'StringTrim', 'projectSearchText' => 'StripTags', 'page' => 'digits'), array(
'projectSearchText' => array(
new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)),
'presence' => 'required'
),
'page' => 'digits'
), $this->getAllParams());
if ($filterInput->hasInvalid()) {
$this->_helper->viewRenderer('searchError');
$this->view->messages = $filterInput->getMessages();
return;
}
$inputFilterParams['projectSearchText'] = $filterInput->getUnescaped('projectSearchText');
$page = (int)$filterInput->getEscaped('page');
$config = Zend_Registry::get('config');
Zend_Search_Lucene_Search_QueryParser::setDefaultEncoding('utf-8');
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive());
$dataPath = $config->settings->search->path;
$dataPath .= $this->getNameForStoreClient() . DIRECTORY_SEPARATOR;
$index = Zend_Search_Lucene::open($dataPath);
try {
$hits = $index->find($inputFilterParams['projectSearchText'] . '*');
} catch (Zend_Search_Lucene_Exception $e) {
Zend_Registry::get('logger')->err(__METHOD__ . ' - ' . $e->getMessage() . PHP_EOL . $e->getTraceAsString());
$hits = array();
}
if (count($hits) == 0) {
$this->_helper->viewRenderer('searchError');
$this->view->inputFilter = $inputFilterParams;
$this->view->searchText = $inputFilterParams['projectSearchText'];
return;
}
$results = $this->copyToArray($hits);
$paginator = Zend_Paginator::factory($results);
$paginator->setDefaultItemCountPerPage(10);
$paginator->setCurrentPageNumber($page);
$this->view->hitsCount = count($hits);
$this->view->hits = $paginator;
$this->view->page = $page;
$this->view->inputFilter = $inputFilterParams;
$this->view->searchText = $inputFilterParams['projectSearchText'];
}
/**
* @param array $hits
*
* @return array
*/
protected function copyToArray($hits)
{
$returnArray = array();
/** @var $hit Zend_Search_Lucene_Search_QueryHit */
foreach ($hits as $hit) {
$returnArray[] = $hit->getDocument();
}
return $returnArray;
}
protected function _initResponseHeader()
{
$duration = 1800; // in seconds
$expires = gmdate("D, d M Y H:i:s", time() + $duration) . " GMT";
$this->getResponse()
->setHeader('X-FRAME-OPTIONS', 'ALLOWALL', true)
// ->setHeader('Last-Modified', $modifiedTime, true)
->setHeader('Expires', $expires, true)->setHeader('Pragma', 'no-cache', true)
->setHeader('Cache-Control', 'private, no-cache, must-revalidate', true)
;
}
/**
* @param Zend_Config $static_config
* @return string|null
*/
protected function getStoreAbout($storeId)
{
$config = Zend_Registry::get('config');
$static_config = $config->settings->static;
$include_path_cat = $static_config->include_path . 'store_about/' . $storeId . '.phtml';
if (file_exists($include_path_cat)) {
return $include_path_cat;
}
return null;
}
/**
* @param array $elements
*
* @return array with additional info's
* @deprecated
*/
private function fetchAdditionalData($elements)
{
$modelProject = new Default_Model_Project();
$requestedElements = Array();
foreach ($elements as $project) {
$info = $modelProject->fetchProductInfo($project['project_id']);
$requestedElements[] = $info;
}
return $requestedElements;
}
protected function setLayout()
{
$layoutName = 'flat_ui_template';
$storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null;
if($storeConfig && $storeConfig->layout_explore)
{
$this->_helper->layout()->setLayout($storeConfig->layout_explore);
}else{
$this->_helper->layout()->setLayout($layoutName);
}
}
/* private function storeFilterOriginalInCookie($inputFilterOriginal)
{
$storedInCookie = $this->getFilterOriginalFromCookie();
if (isset($inputFilterOriginal) AND ($inputFilterOriginal != $storedInCookie)) {
$config = Zend_Registry::get('config');
$cookieName = $config->settings->session->filter_browse_original;
$remember_me_seconds = $config->settings->session->remember_me->cookie_lifetime;
$cookieExpire = time() + $remember_me_seconds;
setcookie($cookieName, $inputFilterOriginal, $cookieExpire, '/');
}
}
private function getFilterOriginalFromCookie()
{
$config = Zend_Registry::get('config');
$cookieName = $config->settings->session->filter_browse_original;
$storedInCookie = isset($_COOKIE[$cookieName]) ? $_COOKIE[$cookieName] : NULL;
return $storedInCookie;
}*/
private function storeFilterTagInCookie($group, $tag)
{
$storedInCookie = $this->getFilterTagFromCookie($group);
if (isset($tag) AND ($tag != $storedInCookie)) {
$config = Zend_Registry::get('config');
$cookieName = $config->settings->session->filter_browse_original.$group;
$remember_me_seconds = $config->settings->session->remember_me->cookie_lifetime;
$cookieExpire = time() + $remember_me_seconds;
setcookie($cookieName, $tag, $cookieExpire, '/');
}
}
private function getFilterTagFromCookie($group)
{
$config = Zend_Registry::get('config');
$cookieName = $config->settings->session->filter_browse_original.$group;
$storedInCookie = isset($_COOKIE[$cookieName]) ? $_COOKIE[$cookieName] : NULL;
return $storedInCookie;
}
public function savetaggroupfilterAction()
{
// Filter-Parameter
$tagGroupId = (int)$this->getParam('group_id', null);
$tagId = (int)$this->getParam('tag_id', null);
$this->storeFilterTagInCookie($tagGroupId, $tagId);
$response = array();
$response['Result'] = 'OK';
$this->_helper->json($response);
}
}
\ No newline at end of file
diff --git a/application/modules/default/controllers/ProductController.php b/application/modules/default/controllers/ProductController.php
index 52ecf3012..710494b69 100644
--- a/application/modules/default/controllers/ProductController.php
+++ b/application/modules/default/controllers/ProductController.php
@@ -1,3194 +1,3223 @@
.
**/
class ProductController extends Local_Controller_Action_DomainSwitch
{
const IMAGE_SMALL_UPLOAD = 'image_small_upload';
const IMAGE_BIG_UPLOAD = 'image_big_upload';
/**
* Zend_Controller_Request_Abstract object wrapping the request environment
*
* @var Zend_Controller_Request_Http
*/
protected $_request = null;
/** @var int */
protected $_projectId;
/** @var int */
protected $_collectionId;
/** @var Zend_Auth */
protected $_auth;
/** @var string */
protected $_browserTitlePrepend;
public function init()
{
parent::init();
$this->_projectId = (int)$this->getParam('project_id');
$this->_collectionId = (int)$this->getParam('collection_id');
$this->_auth = Zend_Auth::getInstance();
$this->_browserTitlePrepend = $this->templateConfigData['head']['browser_title_prepend'];
$action = $this->getRequest()->getActionName();
$title = $action;
if($action =='add')
{
$title = 'add product';
}else
{
$title = $action;
}
$this->view->headTitle($title . ' - ' . $this->getHeadTitle(), 'SET');
}
public function ratingAction()
{
$this->_helper->layout()->disableLayout();
if (array_key_exists($this->_projectId, $this->_authMember->projects)) {
return;
}
$userRating = (int)$this->getParam('rate', 0);
$modelRating = new Default_Model_DbTable_ProjectRating();
$modelRating->rateForProject($this->_projectId, $this->_authMember->member_id, $userRating);
}
public function pploadAction()
{
$this->_helper->layout->disableLayout();
$modelProduct = new Default_Model_Project();
$productInfo = $modelProduct->fetchProductInfo($this->_projectId);
//create ppload download hash: secret + collection_id + expire-timestamp
$salt = PPLOAD_DOWNLOAD_SECRET;
$collectionID = $productInfo->ppload_collection_id;
$timestamp = time() + 3600; // one hour valid
//20181009 ronald: change hash from MD5 to SHA512
//$hash = md5($salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying
$hash = hash('sha512',$salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying
$this->view->download_hash = $hash;
$this->view->download_timestamp = $timestamp;
$this->view->product = $productInfo;
$this->_helper->viewRenderer('/partials/pploadajax');
}
public function gettaggroupsforcatajaxAction() {
$this->_helper->layout()->disableLayout();
$catId = null;
$fileId = null;
if($this->hasParam('file_id')) {
$fileId = $this->getParam('file_id');
}
if($this->hasParam('project_cat_id')) {
$catId = $this->getParam('project_cat_id');
$catTagModel = new Default_Model_Tags();
$catTagGropuModel = new Default_Model_TagGroup();
$tagGroups = $catTagGropuModel->fetchTagGroupsForCategory($catId);
$tableTags = new Default_Model_DbTable_Tags();
$result = array();
$resultGroup = array();
foreach ($tagGroups as $group) {
$tags = $tableTags->fetchForGroupForSelect($group['tag_group_id']);
$selectedTags = null;
if(!empty($fileId)) {
$selectedTags = $catTagModel->getTagsArray($fileId, Default_Model_DbTable_Tags::TAG_TYPE_FILE,$group['tag_group_id']);
}
$group['tag_list'] = $tags;
$group['selected_tags'] = $selectedTags;
$result[] = $group;
}
$this->_helper->json(array('status' => 'ok', 'ResultSize' => count($tagGroups), 'tag_groups' => $result));
return;
}
$this->_helper->json(array('status' => 'error'));
}
private function getTagGroupsForCat($fileId) {
$modelProduct = new Default_Model_Project();
$productInfo = $modelProduct->fetchProductInfo($this->_projectId);
$catId = $productInfo->project_category_id;
if(!empty($catId)) {
$catTagModel = new Default_Model_Tags();
$catTagGropuModel = new Default_Model_TagGroup();
$tagGroups = $catTagGropuModel->fetchTagGroupsForCategory($catId);
$tableTags = new Default_Model_DbTable_Tags();
$result = array();
foreach ($tagGroups as $group) {
$tags = $tableTags->fetchForGroupForSelect($group['tag_group_id']);
$selectedTags = null;
if(!empty($fileId)) {
$selectedTags = $catTagModel->getTagsArray($fileId, Default_Model_DbTable_Tags::TAG_TYPE_FILE,$group['tag_group_id']);
}
$group['tag_list'] = $tags;
$group['selected_tags'] = $selectedTags;
$result[] = $group;
}
return $result;
}
return null;
}
private function getFileDownloadCount($collection_id, $fileId) {
$modelFiles = new Default_Model_DbTable_PploadFiles();
$countAll = $modelFiles->fetchCountDownloadsForFileAllTime($collection_id, $fileId);
$countToday = $modelFiles->fetchCountDownloadsForFileToday($collection_id, $fileId);
$count = (int)$countAll+ (int)$countToday;
return $count;
}
public function listsamesourceurlAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$modelProduct = new Default_Model_Project();
$productInfo = $modelProduct->fetchProductInfo($this->_projectId);
$result = $modelProduct->getSourceUrlProjects($productInfo->source_url);
$r = '
';
foreach ($result as $value) {
$r=$r.'
'
.'
'.$value['title'].'
'
.'
'
.'
'.$value['created_at'].'
'
.'
'.$value['changed_at'].'
'
.'
';
}
$r = $r.'
';
/*$response='';*/
echo $r;
}
public function getfilesajaxAction() {
$this->_helper->layout()->disableLayout();
$collection_id = null;
$file_status = null;
$ignore_status_code = null;
$helperUserRole = new Backend_View_Helper_UserRole();
$userRoleName = $helperUserRole->userRole();
if($this->hasParam('status')) {
$file_status = $this->getParam('status');
}
if($this->hasParam('ignore_status_code')) {
$ignore_status_code = $this->getParam('ignore_status_code');
}
$filesTable = new Default_Model_DbTable_PploadFiles();
if($this->hasParam('collection_id')) {
$collection_id = $this->getParam('collection_id');
$result = array();
$isForAdmin = false;
if ($userRoleName == Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN) {
$isForAdmin = true;
}
//Load files from DB
if($ignore_status_code == 0 && $file_status == 'active') {
$files = $filesTable->fetchAllActiveFilesForProject($collection_id, $isForAdmin);
} else {
$files = $filesTable->fetchAllFilesForProject($collection_id, $isForAdmin);
}
//Check, if the project category has tag-grous
$modelProduct = new Default_Model_Project();
$productInfo = $modelProduct->fetchProductInfo($this->_projectId);
$catTagGropuModel = new Default_Model_TagGroup();
$tagGroups = $catTagGropuModel->fetchTagGroupsForCategory($productInfo->project_category_id);
foreach ($files as $file) {
//add tag grous, if needed
if(!empty($tagGroups)) {
$groups = $this->getTagGroupsForCat($file['id']);
$file['tag_groups'] = $groups;
}
//Download Counter
//new counter IP based
$counterUkAll = $file['count_dl_all_uk'];
$counterNoUkAll = $file['count_dl_all_nouk'];
$counterUkToday = $file['count_dl_uk_today'];
$counterNew = 0;
if(!empty($counterUkAll)) {
$counterNew = $counterNew + $counterUkAll;
}
if(!empty($counterUkToday)) {
$counterNew = $counterNew + $counterUkToday;
}
if(!empty($counterNoUkAll)) {
$counterNew = $counterNew + $counterNoUkAll;
}
$file['downloaded_count_uk'] = $counterNew;
if ($userRoleName == Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN) {
//$file['downloaded_count_live'] = $this->getFileDownloadCount($collection_id, $file['id']);
$counterToday = $file['count_dl_today'];
$counterAll = $file['count_dl_all'];
$counter = 0;
if(!empty($counterToday)) {
$counter = $counterToday;
}
if(!empty($counterAll)) {
$counter = $counter + $counterAll;
}
$file['downloaded_count_live'] = $counter;
} else {
unset($file['count_dl_all']);
unset($file['count_dl_all_nouk']);
unset($file['count_dl_all_uk']);
unset($file['count_dl_uk_today']);
unset($file['count_dl_today']);
unset($file['downloaded_count']);
}
$result[] = $file;
}
$this->_helper->json(array('status' => 'success', 'ResultSize' => count($result), 'files' => $result));
return;
}
$this->_helper->json(array('status' => 'error'));
}
public function getfiletagsajaxAction() {
$this->_helper->layout()->disableLayout();
$fileId = null;
if($this->hasParam('file_id')) {
$fileId = $this->getParam('file_id');
$tagModel = new Default_Model_Tags();
$fileTags = $tagModel->getFileTags($fileId);
$this->_helper->json(array('status' => 'ok', 'ResultSize' => count($fileTags), 'file_tags' => $fileTags));
return;
}
$this->_helper->json(array('status' => 'error'));
}
public function initJsonForReact(){
$modelProduct = new Default_Model_Project();
$productInfo = $modelProduct->fetchProductInfo($this->_projectId);
$this->view->product = $productInfo;
if (empty($this->view->product)) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
}
if(null != $this->_authMember) {
$this->view->authMemberJson = Zend_Json::encode( Default_Model_Member::cleanAuthMemberForJson($this->_authMember) );
}
$helpAddDefaultScheme = new Default_View_Helper_AddDefaultScheme();
$this->view->product->title = Default_Model_HtmlPurify::purify($this->view->product->title);
$this->view->product->description = Default_Model_BBCode::renderHtml(Default_Model_HtmlPurify::purify($this->view->product->description));
$this->view->product->version = Default_Model_HtmlPurify::purify($this->view->product->version);
$this->view->product->link_1 = Default_Model_HtmlPurify::purify($helpAddDefaultScheme->addDefaultScheme($this->view->product->link_1),Default_Model_HtmlPurify::ALLOW_URL);
$this->view->product->source_url = Default_Model_HtmlPurify::purify($this->view->product->source_url,Default_Model_HtmlPurify::ALLOW_URL);
$this->view->product->facebook_code = Default_Model_HtmlPurify::purify($this->view->product->facebook_code,Default_Model_HtmlPurify::ALLOW_URL);
$this->view->product->twitter_code = Default_Model_HtmlPurify::purify($this->view->product->twitter_code,Default_Model_HtmlPurify::ALLOW_URL);
$this->view->product->google_code = Default_Model_HtmlPurify::purify($this->view->product->google_code,Default_Model_HtmlPurify::ALLOW_URL);
$this->view->productJson = Zend_Json::encode(Default_Model_Collection::cleanProductInfoForJson($this->view->product) );
$fmodel =new Default_Model_DbTable_PploadFiles();
$files = $fmodel->fetchFilesForProject($this->view->product->ppload_collection_id);
$salt = PPLOAD_DOWNLOAD_SECRET;
$filesList = array();
foreach ($files as $file) {
$timestamp = time() + 3600; // one hour valid
$hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying
$url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp;
if(null != $this->_authMember) {
$url .= '/u/' . $this->_authMember->member_id;
}
$url .= '/lt/filepreview/' . $file['name'];
$file['url'] = urlencode($url);
$filesList[] = $file;
}
$this->view->filesJson = Zend_Json::encode($filesList);
$this->view->filesCntJson = Zend_Json::encode($fmodel->fetchFilesCntForProject($this->view->product->ppload_collection_id));
$tableProjectUpdates = new Default_Model_ProjectUpdates();
$this->view->updatesJson = Zend_Json::encode($tableProjectUpdates->fetchProjectUpdates($this->_projectId));
$tableProjectRatings = new Default_Model_DbTable_ProjectRating();
$ratings = $tableProjectRatings->fetchRating($this->_projectId);
$cntRatingsActive = 0;
foreach ($ratings as $p) {
if($p['rating_active']==1) $cntRatingsActive =$cntRatingsActive+1;
}
$this->view->ratingsJson = Zend_Json::encode($ratings);
$this->view->cntRatingsActiveJson = Zend_Json::encode($cntRatingsActive);
$identity = Zend_Auth::getInstance()->getStorage()->read();
if (Zend_Auth::getInstance()->hasIdentity()){
$ratingOfUserJson = $tableProjectRatings->getProjectRateForUser($this->_projectId,$identity->member_id);
$this->view->ratingOfUserJson = Zend_Json::encode($ratingOfUserJson);
}else{
$this->view->ratingOfUserJson = Zend_Json::encode(null);
}
$tableProjectFollower = new Default_Model_DbTable_ProjectFollower();
$likes = $tableProjectFollower->fetchLikesForProject($this->_projectId);
$this->view->likeJson = Zend_Json::encode($likes);
$projectplings = new Default_Model_ProjectPlings();
$plings = $projectplings->fetchPlingsForProject($this->_projectId);
$this->view->projectplingsJson = Zend_Json::encode($plings);
$tableProject = new Default_Model_Project();
$galleryPictures = $tableProject->getGalleryPictureSources($this->_projectId);
$this->view->galleryPicturesJson = Zend_Json::encode($galleryPictures);
$tagmodel = new Default_Model_Tags();
$tagsuser = $tagmodel->getTagsUser($this->_projectId, Default_Model_Tags::TAG_TYPE_PROJECT);
$tagssystem = $tagmodel->getTagsSystemList($this->_projectId);
$this->view->tagsuserJson = Zend_Json::encode($tagsuser);
$this->view->tagssystemJson = Zend_Json::encode($tagssystem);
$modelComments = new Default_Model_ProjectComments();
$offset = 0;
$testComments = $modelComments->getCommentTreeForProjectList($this->_projectId);
$this->view->commentsJson = Zend_Json::encode($testComments);
$modelClone = new Default_Model_ProjectClone();
$origins = $modelClone->fetchOrigins($this->_projectId);
$this->view->originsJson = Zend_Json::encode($origins);
$related = $modelClone->fetchRelatedProducts($this->_projectId);
$this->view->relatedJson = Zend_Json::encode($related);
$moreProducts = $tableProject->fetchMoreProjects($this->view->product, 8);
$this->view->moreProductsJson = Zend_Json::encode($moreProducts);
$moreProducts = $tableProject->fetchMoreProjectsOfOtherUsr($this->view->product, 8);
$this->view->moreProductsOfOtherUsrJson = Zend_Json::encode($moreProducts);
}
public function indexAction()
{
if (!empty($this->_collectionId)) {
$modelProduct = new Default_Model_Project();
$productInfo = $modelProduct->fetchProductForCollectionId($this->_collectionId);
$this->_projectId = $productInfo->project_id;
}
if (empty($this->_projectId)) {
$this->redirect('/explore');
}
$this->view->paramPageId = (int)$this->getParam('page');
$this->view->member_id = null;
if(null != $this->_authMember && null != $this->_authMember->member_id) {
$this->view->member_id = $this->_authMember->member_id;
}
// $this->fetchDataForIndexView();
$modelProduct = new Default_Model_Project();
$productInfo = $modelProduct->fetchProductInfo($this->_projectId);
if (empty($productInfo)) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
}
//Check if this is a collection
if($productInfo->type_id == $modelProduct::PROJECT_TYPE_COLLECTION) {
$this->redirect('/c/'.$this->_projectId);
}
$this->view->product = $productInfo;
$this->view->headTitle($productInfo->title . ' - ' . $this->getHeadTitle(), 'SET');
$this->view->cat_id = $this->view->product->project_category_id;
//create ppload download hash: secret + collection_id + expire-timestamp
$salt = PPLOAD_DOWNLOAD_SECRET;
$collectionID = $this->view->product->ppload_collection_id;
$timestamp = time() + 3600; // one hour valid
//20181009 ronald: change hash from MD5 to SHA512
//$hash = md5($salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying
$hash = hash('sha512',$salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying
$this->view->download_hash = $hash;
$this->view->download_timestamp = $timestamp;
$helperUserRole = new Backend_View_Helper_UserRole();
$userRoleName = $helperUserRole->userRole();
$isAdmin = false;
if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) {
$isAdmin = true;
}
$helperUserIsOwner = new Default_View_Helper_UserIsOwner();
$helperIsProjectActive = new Default_View_Helper_IsProjectActive();
if (!$isAdmin AND (false === $helperIsProjectActive->isProjectActive($this->view->product->project_status))
AND (false === $helperUserIsOwner->UserIsOwner($this->view->product->member_id))
) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
}
if (APPLICATION_ENV != 'searchbotenv') {
$tablePageViews = new Default_Model_DbTable_StatPageViews();
$tablePageViews->savePageView($this->_projectId, $this->getRequest()->getClientIp(),
$this->_authMember->member_id);
}
$fmodel =new Default_Model_DbTable_PploadFiles();
$filesList = array();
if(isset($this->view->product->ppload_collection_id)) {
$files = $fmodel->fetchFilesForProject($this->view->product->ppload_collection_id);
if(!empty($files)) {
foreach ($files as $file) {
$timestamp = time() + 3600; // one hour valid
$hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying
$url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp;
if(null != $this->_authMember) {
$url .= '/u/' . $this->_authMember->member_id;
}
$url .= '/lt/filepreview/' . $file['name'];
$file['url'] = urlencode($url);
//If this file is a video, we have to convert it for preview
if(!empty($file['type']) && in_array($file['type'], Backend_Commands_ConvertVideo::$VIDEO_FILE_TYPES) && empty($file['ppload_file_preview_id'])) {
$queue = Local_Queue_Factory::getQueue();
$command = new Backend_Commands_ConvertVideo($file['collection_id'], $file['id'], $file['type']);
$queue->send(serialize($command));
}
if(!empty($file['url_preview'])) {
$file['url_preview'] = urlencode($file['url_preview']);
}
if(!empty($file['url_thumb'])) {
$file['url_thumb'] = urlencode($file['url_thumb']);
}
$filesList[] = $file;
}
}
}
$this->view->filesJson = Zend_Json::encode($filesList);
//gitlab
if($this->view->product->is_gitlab_project) {
$gitProject = $this->fetchGitlabProject($this->view->product->gitlab_project_id);
if(null == $gitProject) {
$this->view->product->is_gitlab_project = 0;
$this->view->product->show_gitlab_project_issues = 0;
$this->view->product->use_gitlab_project_readme = 0;
$this->view->product->gitlab_project_id = null;
} else {
$this->view->gitlab_project = $gitProject;
//show issues?
if($this->view->product->show_gitlab_project_issues) {
$issues = $this->fetchGitlabProjectIssues($this->view->product->gitlab_project_id);
$this->view->gitlab_project_issues = $issues;
$this->view->gitlab_project_issues_url = $this->view->gitlab_project['web_url'] . '/issues/';
}
//show readme.md?
if($this->view->product->use_gitlab_project_readme && null != $this->view->gitlab_project['readme_url']) {
$config = Zend_Registry::get('config')->settings->server->opencode;
$readme = $this->view->gitlab_project['web_url'].'/raw/master/README.md?inline=false';
$httpClient = new Zend_Http_Client($readme, array('keepalive' => true, 'strictredirects' => true));
$httpClient->resetParameters();
$httpClient->setUri($readme);
$httpClient->setHeaders('Private-Token', $config->private_token);
$httpClient->setHeaders('Sudo', $config->user_sudo);
$httpClient->setHeaders('User-Agent', $config->user_agent);
$httpClient->setMethod(Zend_Http_Client::GET);
$response = $httpClient->request();
$body = $response->getRawBody();
if (count($body) == 0) {
return array();
}
include_once('Parsedown.php');
$Parsedown = new Parsedown();
$this->view->readme = $Parsedown->text($body);
} else {
$this->view->readme = null;
}
}
}
+ // products related
+ $pc = new Default_Model_ProjectClone();
+ $cntRelatedProducts=0;
+ $ancesters = $pc->fetchAncestersIds($this->_projectId);
+ $siblings = $pc->fetchSiblings($this->_projectId);
+ $parents = $pc->fetchParentIds($this->_projectId);
+ $childrens = $pc->fetchChildrensIds($this->_projectId);
+ $this->view->related_ancesters = null;
+ $this->view->related_siblings = null;
+ $this->view->related_parents = null;
+ $this->view->related_children = null;
+ if($ancesters && strlen($ancesters)>0){
+ $this->view->related_ancesters = $modelProduct->fetchProjects($ancesters);
+ $cntRelatedProducts+= sizeof($this->view->related_ancesters);
+ }
+ if($siblings && strlen($siblings)>0){
+ $this->view->related_siblings = $modelProduct->fetchProjects($siblings);
+ $cntRelatedProducts+= sizeof($this->view->related_siblings);
+ }
+ if($parents && strlen($parents)>0){
+ $this->view->related_parents = $modelProduct->fetchProjects($parents);
+ $cntRelatedProducts+= sizeof($this->view->related_parents);
+ }
+ if($childrens && strlen($childrens)>0){
+ $this->view->related_children = $modelProduct->fetchProjects($childrens);
+ $cntRelatedProducts+= sizeof($this->view->related_children);
+ }
+ $this->view->cntRelatedProducts = $cntRelatedProducts;
+
$storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null;
if($storeConfig->layout_pagedetail && $storeConfig->isRenderReact()){
$this->initJsonForReact();
$this->_helper->viewRenderer('index-react');
}
}
public function showAction()
{
$this->view->authMember = $this->_authMember;
$this->_helper->viewRenderer('index');
$this->indexAction();
}
public function addAction()
{
$this->view->member = $this->_authMember;
$this->view->mode = 'add';
if($this->getParam('catId')){
$this->view->catId = $this->getParam('catId');
}
$form = new Default_Form_Product(array('member_id' => $this->view->member->member_id));
$this->view->form = $form;
if ($this->_request->isGet()) {
return;
}
$helperUserRole = new Backend_View_Helper_UserRole();
$userRoleName = $helperUserRole->userRole();
$isAdmin = false;
if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) {
$isAdmin = true;
}
if (isset($_POST['cancel'])) { // user cancel function
$this->redirect('/member/' . $this->_authMember->member_id . '/news/');
}
if (false === $form->isValid($_POST)) { // form not valid
$this->view->form = $form;
$this->view->error = 1;
return;
}
$values = $form->getValues();
$imageModel = new Default_Model_DbTable_Image();
try {
$values['image_small'] = $imageModel->saveImage($form->getElement(self::IMAGE_SMALL_UPLOAD));
} catch (Exception $e) {
Zend_Registry::get('logger')->err(__METHOD__ . ' - ERROR upload productPicture - ' . print_r($e, true));
}
// form was valid, so we can set status to active
$values['status'] = Default_Model_DbTable_Project::PROJECT_ACTIVE;
// save new project
$modelProject = new Default_Model_Project();
Zend_Registry::get('logger')->info(__METHOD__ . ' - $post: ' . print_r($_POST, true));
Zend_Registry::get('logger')->info(__METHOD__ . ' - $files: ' . print_r($_FILES, true));
Zend_Registry::get('logger')->info(__METHOD__ . ' - input values: ' . print_r($values, true));
$newProject = null;
try {
if (isset($values['project_id'])) {
$newProject = $modelProject->updateProject($values['project_id'], $values);
} else {
$newProject = $modelProject->createProject($this->_authMember->member_id, $values, $this->_authMember->username);
//$this->createSystemPlingForNewProject($newProject->project_id);
}
} catch (Exception $exc) {
Zend_Registry::get('logger')->warn(__METHOD__ . ' - traceString: ' . $exc->getTraceAsString());
}
if (!$newProject) {
$this->_helper->flashMessenger->addMessage('You did not choose a Category in the last level.
');
$this->forward('add');
return;
}
//update the gallery pics
$mediaServerUrls = $this->saveGalleryPics($form->gallery->upload->upload_picture);
$modelProject->updateGalleryPictures($newProject->project_id, $mediaServerUrls);
//If there is no Logo, we take the 1. gallery pic
if (!isset($values['image_small']) || $values['image_small'] == '') {
$values['image_small'] = $mediaServerUrls[0];
$newProject = $modelProject->updateProject($newProject->project_id, $values);
}
//New Project in Session, for AuthValidation (owner)
$this->_auth->getIdentity()->projects[$newProject->project_id] = array('project_id' => $newProject->project_id);
$modelTags = new Default_Model_Tags();
if ($values['tagsuser']) {
$modelTags->processTagsUser($newProject->project_id, implode(',', $values['tagsuser']),Default_Model_Tags::TAG_TYPE_PROJECT);
} else {
$modelTags->processTagsUser($newProject->project_id, null, Default_Model_Tags::TAG_TYPE_PROJECT);
}
$modelTags->processTagProductOriginalOrModification($newProject->project_id,$values['is_original_or_modification'][0]);
//set license, if needed
$licenseTag = $form->getElement('license_tag_id')->getValue();
//only set/update license tags if something was changed
if ($licenseTag && count($licenseTag) > 0) {
$modelTags->saveLicenseTagForProject($newProject->project_id, $licenseTag);
$activityLog = new Default_Model_ActivityLog();
$activityLog->logActivity($newProject->project_id, $newProject->project_id, $this->_authMember->member_id,Default_Model_ActivityLog::PROJECT_LICENSE_CHANGED, array('title' => 'Set new License Tag', 'description' => 'New TagId: ' . $licenseTag));
}
$isGitlabProject = $form->getElement('is_gitlab_project')->getValue();
$gitlabProjectId = $form->getElement('gitlab_project_id')->getValue();
if ($isGitlabProject && $gitlabProjectId == 0) {
$values['gitlab_project_id'] = null;
}
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($newProject->project_id, $newProject->member_id, Default_Model_ActivityLog::PROJECT_CREATED, $newProject->toArray());
// ppload
$this->processPploadId($newProject);
try {
if (100 < $this->_authMember->roleId) {
if (Default_Model_Spam::hasSpamMarkers($newProject->toArray())) {
$tableReportComments = new Default_Model_DbTable_ReportProducts();
$tableReportComments->save(array('project_id' => $newProject->project_id, 'reported_by' => 24, 'text' => "System: automatic spam detection"));
}
Default_Model_DbTable_SuspicionLog::logProject($newProject, $this->_authMember, $this->getRequest());
}
} catch (Zend_Exception $e) {
Zend_Registry::get('logger')->err($e->getMessage());
}
$this->redirect('/member/' . $newProject->member_id . '/products/');
}
private function saveGalleryPics($form_element)
{
$imageModel = new Default_Model_DbTable_Image();
return $imageModel->saveImages($form_element);
}
/**
* @param $projectData
*
* @throws Zend_Exception
* @throws Zend_Queue_Exception
*/
protected function createTaskWebsiteOwnerVerification($projectData)
{
if (empty($projectData->link_1)) {
return;
}
$checkAuthCode = new Local_Verification_WebsiteProject();
$authCode = $checkAuthCode->generateAuthCode(stripslashes($projectData->link_1));
$queue = Local_Queue_Factory::getQueue();
$command = new Backend_Commands_CheckProjectWebsite($projectData->project_id, $projectData->link_1, $authCode);
$queue->send(serialize($command));
}
/**
* @param $projectData
*/
protected function processPploadId($projectData)
{
if ($projectData->ppload_collection_id) {
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
// Update collection information
$collectionCategory = $projectData->project_category_id;
if (Default_Model_Project::PROJECT_ACTIVE == $projectData->status) {
$collectionCategory .= '-published';
}
$collectionRequest = array(
'title' => $projectData->title,
'description' => $projectData->description,
'category' => $collectionCategory,
'content_id' => $projectData->project_id
);
$collectionResponse = $pploadApi->putCollection($projectData->ppload_collection_id, $collectionRequest);
// Store product image as collection thumbnail
$this->_updatePploadMediaCollectionthumbnail($projectData);
}
}
/**
* ppload
*/
protected function _updatePploadMediaCollectionthumbnail($projectData)
{
if (empty($projectData->ppload_collection_id)
|| empty($projectData->image_small)
) {
return false;
}
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
$filename = sys_get_temp_dir() . '/' . $projectData->image_small;
if (false === file_exists(dirname($filename))) {
mkdir(dirname($filename), 0777, true);
}
$viewHelperImage = new Default_View_Helper_Image();
$uri = $viewHelperImage->Image($projectData->image_small, array(
'width' => 600,
'height' => 600
));
file_put_contents($filename, file_get_contents($uri));
$mediaCollectionthumbnailResponse =
$pploadApi->postMediaCollectionthumbnail($projectData->ppload_collection_id, array('file' => $filename));
unlink($filename);
if (isset($mediaCollectionthumbnailResponse->status)
&& $mediaCollectionthumbnailResponse->status == 'success'
) {
return true;
}
return false;
}
public function editAction()
{
if (empty($this->_projectId)) {
$this->redirect($this->_helper->url('add'));
return;
}
$this->_helper->viewRenderer('add'); // we use the same view as you can see at add a product
$this->view->mode = 'edit';
$projectTable = new Default_Model_DbTable_Project();
$projectModel = new Default_Model_Project();
$modelTags = new Default_Model_Tags();
$tagTable = new Default_Model_DbTable_Tags();
//check if product with given id exists
$projectData = $projectTable->find($this->_projectId)->current();
if (empty($projectData)) {
$this->redirect($this->_helper->url('add'));
return;
}
$member = null;
if (isset($this->_authMember) AND (false === empty($this->_authMember->member_id))) {
$member = $this->_authMember;
} else {
throw new Zend_Controller_Action_Exception('no authorization found');
}
if (("admin" == $this->_authMember->roleName)) {
$modelMember = new Default_Model_Member();
$member = $modelMember->fetchMember($projectData->member_id, false);
}
$helperUserRole = new Backend_View_Helper_UserRole();
$userRoleName = $helperUserRole->userRole();
$isAdmin = false;
if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) {
$isAdmin = true;
}
//set ppload-collection-id in view
$this->view->ppload_collection_id = $projectData->ppload_collection_id;
$this->view->project_id = $projectData->project_id;
$this->view->product = $projectData;
//create ppload download hash: secret + collection_id + expire-timestamp
$salt = PPLOAD_DOWNLOAD_SECRET;
$collectionID = $projectData->ppload_collection_id;
$timestamp = time() + 3600; // one hour valid
//20181009 ronald: change hash from MD5 to SHA512
//$hash = md5($salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying
$hash = hash('sha512',$salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying
$this->view->download_hash = $hash;
$this->view->download_timestamp = $timestamp;
$this->view->member_id = $member->member_id;
$this->view->member = $member;
//read the already existing gallery pics and add them to the form
$sources = $projectModel->getGalleryPictureSources($this->_projectId);
//get the gitlab projects for this user
//setup form
$form = new Default_Form_Product(array('pictures' => $sources, 'member_id' => $this->view->member_id));
if (false === empty($projectData->image_small)) {
$form->getElement('image_small_upload')->setRequired(false);
}
$form->getElement('preview')->setLabel('Save');
$form->removeElement('project_id'); // we don't need this field in edit mode
if ($this->_request->isGet()) {
$form->populate($projectData->toArray());
// $form->populate(array('tags' => $modelTags->getTags($projectData->project_id, Default_Model_Tags::TAG_TYPE_PROJECT)));
$form->populate(array('tagsuser' => $modelTags->getTagsUser($projectData->project_id, Default_Model_Tags::TAG_TYPE_PROJECT)));
$form->getElement('image_small')->setValue($projectData->image_small);
//Bilder voreinstellen
$form->getElement(self::IMAGE_SMALL_UPLOAD)->setValue($projectData->image_small);
$licenseTags = $tagTable->fetchLicenseTagsForProject($this->_projectId);
$licenseTag = null;
if($licenseTags) {
$licenseTag = $licenseTags[0]['tag_id'];
}
$form->getElement('license_tag_id')->setValue($licenseTag);
$is_original = $modelTags->isProductOriginal($projectData->project_id);
$is_modification = $modelTags->isProductModification($projectData->project_id);
if($is_original){
$form->getElement('is_original_or_modification')->setValue(1);
} else if($is_modification){
$form->getElement('is_original_or_modification')->setValue(2);
}
$this->view->form = $form;
return;
}
if (isset($_POST['cancel'])) { // user cancel function
$this->redirect('/member/' . $member->member_id . '/news/');
}
if (false === $form->isValid($_POST, $this->_projectId)) { // form not valid
$this->view->form = $form;
$this->view->error = 1;
return;
}
$values = $form->getValues();
//set license, if needed
$tagList = $modelTags->getTagsArray($this->_projectId, $modelTags::TAG_TYPE_PROJECT, $modelTags::TAG_LICENSE_GROUPID);
$oldLicenseTagId = null;
if($tagList && count($tagList) == 1) {
$oldLicenseTagId = $tagList[0]['tag_id'];
}
$licenseTag = $form->getElement('license_tag_id')->getValue();
//only set/update license tags if something was changed
if($licenseTag <> $oldLicenseTagId) {
$modelTags->saveLicenseTagForProject($this->_projectId, $licenseTag);
$activityLog = new Default_Model_ActivityLog();
$activityLog->logActivity($this->_projectId, $this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_LICENSE_CHANGED, array('title' => 'License Tag', 'description' => 'Old TagId: '.$oldLicenseTagId.' - New TagId: '.$licenseTag));
}
//gitlab project
$isGitlabProject = $form->getElement('is_gitlab_project')->getValue();
$gitlabProjectId = $form->getElement('gitlab_project_id')->getValue();
if($isGitlabProject && $gitlabProjectId == 0) {
$values['gitlab_project_id'] = null;
}
$imageModel = new Default_Model_DbTable_Image();
try {
$uploadedSmallImage = $imageModel->saveImage($form->getElement(self::IMAGE_SMALL_UPLOAD));
$values['image_small'] = $uploadedSmallImage ? $uploadedSmallImage : $values['image_small'];
} catch (Exception $e) {
Zend_Registry::get('logger')->err(__METHOD__ . ' - ERROR upload productPicture - ' . print_r($e, true));
}
// save changes
$projectModel->updateProject($this->_projectId, $values);
//update the gallery pics
$pictureSources = array_merge($values['gallery']['online_picture'],
$this->saveGalleryPics($form->gallery->upload->upload_picture));
$projectModel->updateGalleryPictures($this->_projectId, $pictureSources);
//If there is no Logo, we take the 1. gallery pic
if (!isset($projectData->image_small) || $projectData->image_small == '') {
$projectData->image_small = $pictureSources[0];
}
//20180219 ronald: we set the changed_at only by new files or new updates
//$projectData->changed_at = new Zend_Db_Expr('NOW()');
$projectData->save();
$modelTags->processTagProductOriginalOrModification($this->_projectId,$values['is_original_or_modification'][0]);
if($values['tagsuser']) {
$modelTags->processTagsUser($this->_projectId,implode(',',$values['tagsuser']), Default_Model_Tags::TAG_TYPE_PROJECT);
}else
{
$modelTags->processTagsUser($this->_projectId,null, Default_Model_Tags::TAG_TYPE_PROJECT);
}
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_EDITED, $projectData->toArray());
// ppload
$this->processPploadId($projectData);
try {
if (100 < $this->_authMember->roleId) {
if (Default_Model_Spam::hasSpamMarkers($projectData->toArray())) {
$tableReportComments = new Default_Model_DbTable_ReportProducts();
$tableReportComments->save(array('project_id' => $projectData->project_id, 'reported_by' => 24, 'text' => "System: automatic spam detection on product edit"));
}
Default_Model_DbTable_SuspicionLog::logProject($projectData, $this->_authMember, $this->getRequest());
}
} catch (Zend_Exception $e) {
Zend_Registry::get('logger')->err($e->getMessage());
}
$helperBuildMemberUrl = new Default_View_Helper_BuildMemberUrl();
$this->redirect($helperBuildMemberUrl->buildMemberUrl($member->username, 'products'));
}
public function getupdatesajaxAction()
{
$this->view->authMember = $this->_authMember;
$tableProject = new Default_Model_ProjectUpdates();
$updates = $tableProject->fetchProjectUpdates($this->_projectId);
foreach ($updates as $key => $update) {
$updates[$key]['title'] = Default_Model_HtmlPurify::purify($update['title']);
$updates[$key]['text'] = Default_Model_BBCode::renderHtml(Default_Model_HtmlPurify::purify(htmlentities($update['text'], ENT_QUOTES | ENT_IGNORE)));
$updates[$key]['raw_title'] = $update['title'];
$updates[$key]['raw_text'] = $update['text'];
}
$result['status'] = 'success';
$result['ResultSize'] = count($updates);
$result['updates'] = $updates;
$this->_helper->json($result);
}
public function saveupdateajaxAction()
{
$filter =
new Zend_Filter_Input(
array(
'*' => 'StringTrim'
),
array(
'*' => array(),
'title' => array(
new Zend_Validate_StringLength(array('min' => 3, 'max' => 200)),
'presence' => 'required',
'allowEmpty' => false
),
'text' => array(
new Zend_Validate_StringLength(array('min' => 3, 'max' => 16383)),
'presence' => 'required',
'allowEmpty' => false
),
'update_id' => array('digits', 'allowEmpty' => true)
), $this->getAllParams(), array('allowEmpty' => true));
if ($filter->hasInvalid() OR $filter->hasMissing() OR $filter->hasUnknown()) {
$result['status'] = 'error';
$result['messages'] = $filter->getMessages();
$result['update_id'] = null;
$this->_helper->json($result);
}
$update_id = $filter->getEscaped('update_id');
$tableProjectUpdates = new Default_Model_ProjectUpdates();
//Save update
if (!empty($update_id)) {
//Update old update
$updateArray = array();
$updateArray['title'] = $filter->getUnescaped('title');
$updateArray['text'] = $filter->getUnescaped('text');
$updateArray['changed_at'] = new Zend_Db_Expr('Now()');
$countUpdated = $tableProjectUpdates->update($updateArray, 'project_update_id = ' . $update_id);
} else {
//Add new update
$updateArray = array();
$updateArray['title'] = $filter->getUnescaped('title');
$updateArray['text'] = $filter->getUnescaped('text');
$updateArray['public'] = 1;
$updateArray['project_id'] = $this->_projectId;
$updateArray['member_id'] = $this->_authMember->member_id;
$updateArray['created_at'] = new Zend_Db_Expr('Now()');
$updateArray['changed_at'] = new Zend_Db_Expr('Now()');
$rowset = $tableProjectUpdates->save($updateArray);
$update_id = $rowset->project_update_id;
//20180219 ronald: we set the changed_at only by new files or new updates
$projectTable = new Default_Model_Project();
$projectUpdateRow = $projectTable->find($this->_projectId)->current();
if (count($projectUpdateRow) == 1) {
$projectUpdateRow->changed_at = new Zend_Db_Expr('NOW()');
$projectUpdateRow->save();
}
}
$result['status'] = 'success';
$result['update_id'] = $update_id;
$this->_helper->json($result);
}
public function deleteupdateajaxAction()
{
$this->view->authMember = $this->_authMember;
$tableProject = new Default_Model_ProjectUpdates();
$params = $this->getAllParams();
$project_update_id = $params['update_id'];
$updateArray = array();
$updateArray['public'] = 0;
$updateArray['changed_at'] = new Zend_Db_Expr('Now()');
$tableProject->update($updateArray, 'project_update_id = ' . $project_update_id);
$result['status'] = 'success';
$result['update_id'] = $project_update_id;
$this->_helper->json($result);
}
public function updatesAction()
{
$this->view->authMember = $this->_authMember;
$tableProject = new Default_Model_Project();
$this->view->product = $tableProject->fetchProductInfo($this->_projectId);
if (false === isset($this->view->product)) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
}
$this->view->relatedProducts = $tableProject->fetchSimilarProjects($this->view->product, 6);
$this->view->supporter = $tableProject->fetchProjectSupporter($this->_projectId);
$this->view->product_views = $tableProject->fetchProjectViews($this->_projectId);
$modelPlings = new Default_Model_DbTable_Plings();
$this->view->comments = $modelPlings->getCommentsForProject($this->_projectId, 10);
$tableMember = new Default_Model_Member();
$this->view->member = $tableMember->fetchMemberData($this->view->product->member_id);
$this->view->updates = $tableProject->fetchProjectUpdates($this->_projectId);
$tablePageViews = new Default_Model_DbTable_StatPageViews();
$tablePageViews->savePageView($this->_projectId, $this->getRequest()->getClientIp(),
$this->_authMember->member_id);
}
public function updateAction()
{
$this->_helper->layout()->setLayout('flat_ui');
$this->view->headScript()->setFile('');
$this->view->headLink()->setStylesheet('');
$this->_helper->viewRenderer('add');
$form = new Default_Form_ProjectUpdate();
$projectTable = new Default_Model_Project();
$projectData = null;
$projectUpdateId = (int)$this->getParam('upid');
$this->view->member = $this->_authMember;
$this->view->title = 'Add an update for your product';
$activityLogType = Default_Model_ActivityLog::PROJECT_ITEM_CREATED;
if (false === empty($projectUpdateId)) {
$this->view->title = 'Edit an product update';
$projectData = $projectTable->find($projectUpdateId)->current();
$form->populate($projectData->toArray());
$form->getElement('upid')->setValue($projectUpdateId);
$activityLogType = Default_Model_ActivityLog::PROJECT_ITEM_EDITED;
}
$this->view->form = $form;
if ($this->_request->isGet()) {
return;
}
if (isset($_POST['cancel'])) { // user cancel function
$this->_redirect('/member/' . $this->_authMember->member_id . '/news/');
}
if (false === $form->isValid($_POST)) { // form not valid
$this->view->form = $form;
$this->view->error = 1;
return;
}
$values = $form->getValues();
$projectUpdateRow = $projectTable->find($values['upid'])->current();
if (count($projectUpdateRow) == 0) {
$projectUpdateRow = $projectTable->createRow($values);
$projectUpdateRow->project_id = $values['upid'];
$projectUpdateRow->created_at = new Zend_Db_Expr('NOW()');
$projectUpdateRow->start_date = new Zend_Db_Expr('NOW()');
$projectUpdateRow->member_id = $this->_authMember->member_id;
$projectUpdateRow->creator_id = $this->_authMember->member_id;
$projectUpdateRow->status = Default_Model_Project::PROJECT_ACTIVE;
$projectUpdateRow->type_id = 2;
$projectUpdateRow->pid = $this->_projectId;
} else {
$projectUpdateRow->setFromArray($values);
//20180219 ronald: we set the changed_at only by new files or new updates
//$projectUpdateRow->changed_at = new Zend_Db_Expr('NOW()');
}
$lastId = $projectUpdateRow->save();
//New Project in Session, for AuthValidation (owner)
$this->_auth->getIdentity()->projects[$lastId] = array('project_id' => $lastId);
$tableProduct = new Default_Model_Project();
$product = $tableProduct->find($this->_projectId)->current();
$activityLogValues = $projectUpdateRow->toArray();
$activityLogValues['image_small'] = $product->image_small;
$activityLog = new Default_Model_ActivityLog();
//$activityLog->writeActivityLog($lastId, $projectUpdateRow->member_id, $activityLogType, $activityLogValues);
$activityLog->writeActivityLog($lastId, $this->_authMember->member_id, $activityLogType, $activityLogValues);
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
$urlProjectShow = $helperBuildProductUrl->buildProductUrl($this->_projectId);
$this->redirect($urlProjectShow);
}
public function previewAction()
{
$this->view->authMember = $this->_authMember;
$form = new Default_Form_ProjectConfirm();
if ($this->_request->isGet()) {
$form->populate(get_object_vars($this->_authMember));
$this->view->form = $form;
$this->fetchDataForIndexView();
$this->view->preview = $this->view->render('product/index.phtml');
return;
}
if (isset($_POST['save'])) {
$projectTable = new Default_Model_Project();
$projectTable->setStatus(Default_Model_Project::PROJECT_INACTIVE, $this->_projectId);
//todo: maybe we have to delete the project data from database otherwise we produce many zombies
$this->redirect('/member/' . $this->_authMember->member_id . '/products/');
}
if (isset($_POST['back'])) {
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
$this->redirect($helperBuildProductUrl->buildProductUrl($this->_projectId, 'edit'));
}
if (false === $form->isValid($_POST)) { // form not valid
$this->view->form = $form;
$this->fetchDataForIndexView();
$this->view->preview = $this->view->render('product/index.phtml');
$this->view->error = 1;
return;
}
$projectTable = new Default_Model_Project();
$projectTable->setStatus(Default_Model_Project::PROJECT_ACTIVE, $this->_projectId);
// add to search index
$modelProject = new Default_Model_Project();
$productInfo = $modelProject->fetchProductInfo($this->_projectId);
$modelSearch = new Default_Model_Search_Lucene();
$modelSearch->addDocument($productInfo->toArray());
$this->redirect('/member/' . $this->_authMember->member_id . '/products/');
}
protected function fetchDataForIndexView()
{
$tableProject = new Default_Model_Project();
$this->view->product = $tableProject->fetchProductInfo($this->_projectId);
if (false === isset($this->view->product)) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
}
$desc = $this->view->product->description;
$newDesc = $this->bbcode2html($desc);
$this->view->product->description = $newDesc;
// switch off temporally 02.05.2017
//$this->view->supporting = $tableProject->fetchProjectSupporterWithPlings($this->_projectId);
//$orgUpdates = $tableProjectUpdates->fetchLastProjectUpdate($this->_projectId);
$tableProjectUpdates = new Default_Model_ProjectUpdates();
$orgUpdates = $tableProjectUpdates->fetchProjectUpdates($this->_projectId);
$newUpdates = array();
foreach ($orgUpdates as $update) {
$desc = $update['text'];
$newDesc = $this->bbcode2html($desc);
$update['text'] = $newDesc;
$newUpdates[] = $update;
}
$this->view->updates = $newUpdates;
// switch off temporally 02.05.2017
//$this->view->supporter = $tableProject->fetchProjectSupporter($this->_projectId);
$this->view->galleryPictures = $tableProject->getGalleryPictureSources($this->_projectId);
$this->view->product_views = $tableProject->fetchProjectViews($this->_projectId);
$helperFetchCategory = new Default_View_Helper_CatTitle();
$helperFetchCatParent = new Default_View_Helper_CatParent();
$this->view->catId = $this->view->product->project_category_id;
$this->view->catTitle = $helperFetchCategory->catTitle($this->view->product->project_category_id);
$this->view->catParentId =
$helperFetchCatParent->getCatParentId(array('project_category_id' => $this->view->product->project_category_id));
if ($this->view->catParentId) {
$this->view->catParentTitle = $helperFetchCategory->catTitle($this->view->catParentId);
}
$AuthCodeExist = new Local_Verification_WebsiteProject();
$this->view->websiteAuthCode = $AuthCodeExist->generateAuthCode(stripslashes($this->view->product->link_1));
// switch off temporally 02.05.2017
//$modelPlings = new Default_Model_DbTable_Plings();
//$this->view->plings = $modelPlings->getDonationsForProject($this->_projectId, 10);
$tableMember = new Default_Model_Member();
$this->view->member = $tableMember->fetchMemberData($this->view->product->member_id);
$this->view->more_products = $tableProject->fetchMoreProjects($this->view->product, 8);
$this->view->more_products_otheruser = $tableProject->fetchMoreProjectsOfOtherUsr($this->view->product, 8);
$widgetDefaultModel = new Default_Model_DbTable_ProjectWidgetDefault();
$widgetDefault = $widgetDefaultModel->fetchConfig($this->_projectId);
$widgetDefault->text->headline = $this->view->product->title;
//$widgetDefault->amounts->current = $this->view->product->amount_received;
$widgetDefault->amounts->goal = $this->view->product->amount;
$widgetDefault->project = $this->_projectId;
$this->view->widgetConfig = $widgetDefault;
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
$this->view->permaLink = $helperBuildProductUrl->buildProductUrl($this->_projectId, null, null, true);
$this->view->urlPay = $helperBuildProductUrl->buildProductUrl($this->_projectId, 'pay');
$referrerUrl = $this->readExploreUrlFromReferrer();
if (false === empty($referrerUrl)) {
$this->view->referrerUrl = $referrerUrl;
}
}
/**
* transforms a string with bbcode markup into html
*
* @param string $txt
* @param bool $nl2br
*
* @return string
*/
private function bbcode2html($txt, $nl2br = true, $forcecolor = '')
{
if (!empty($forcecolor)) {
$fc = ' style="color:' . $forcecolor . ';"';
} else {
$fc = '';
}
$newtxt = htmlspecialchars($txt);
if ($nl2br) {
$newtxt = nl2br($newtxt);
}
$patterns = array(
'`\[b\](.+?)\[/b\]`is',
'`\[i\](.+?)\[/i\]`is',
'`\[u\](.+?)\[/u\]`is',
'`\[li\](.+?)\[/li\]`is',
'`\[strike\](.+?)\[/strike\]`is',
'`\[url\]([a-z0-9]+?://){1}([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)\[/url\]`si',
'`\[quote\](.+?)\[/quote\]`is',
'`\[indent](.+?)\[/indent\]`is'
);
$replaces = array(
'\\1 ',
'\\1 ',
'\\1 ',
'\\1 ',
'\\1 ',
'\1\2 ',
'Quote: \1
',
'\\1 '
);
$newtxt = preg_replace($patterns, $replaces, $newtxt);
return ($newtxt);
}
protected function readExploreUrlFromReferrer()
{
$helperBuildExploreUrl = new Default_View_Helper_BuildExploreUrl();
$referrerExplore = $helperBuildExploreUrl->buildExploreUrl(null, null, null, null, true);
/** @var Zend_Controller_Request_Http $request */
$request = $this->getRequest();
if (strpos($request->getHeader('referer'), $referrerExplore) !== false) {
return $request->getHeader('referer');
}
}
public function plingAction()
{
if (empty($this->_projectId)) {
$this->redirect('/explore');
}
$this->view->authMember = $this->_authMember;
$this->fetchDataForIndexView();
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
$this->view->urlPay = $helperBuildProductUrl->buildProductUrl($this->_projectId, 'pay');
$this->view->amount = (float)$this->getParam('amount', 1);
$this->view->comment = html_entity_decode(strip_tags($this->getParam('comment'), null), ENT_QUOTES, 'utf-8');
$this->view->provider =
mb_strtolower(html_entity_decode(strip_tags($this->getParam('provider'), null), ENT_QUOTES, 'utf-8'),
'utf-8');
$this->view->headTitle($this->_browserTitlePrepend . $this->view->product->title, 'SET');
$helperUserIsOwner = new Default_View_Helper_UserIsOwner();
$helperIsProjectActive = new Default_View_Helper_IsProjectActive();
if ((false === $helperIsProjectActive->isProjectActive($this->view->product->project_status)) AND (false
=== $helperUserIsOwner->UserIsOwner($this->view->product->member_id))
) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
}
$tableProject = new Default_Model_Project();
$this->view->supporting = $tableProject->fetchProjectSupporterWithPlings($this->_projectId);
}
public function payAction()
{
$this->_helper->layout()->disableLayout();
$tableProject = new Default_Model_Project();
$project = $tableProject->fetchProductInfo($this->_projectId);
//get parameter
$amount = (float)$this->getParam('amount', 1);
$comment = Default_Model_HtmlPurify::purify($this->getParam('comment'));
$paymentProvider =
mb_strtolower(html_entity_decode(strip_tags($this->getParam('provider'), null), ENT_QUOTES, 'utf-8'),
'utf-8');
$hideIdentity = (int)$this->getParam('hideId', 0);
$paymentGateway = $this->createPaymentGateway($paymentProvider);
$paymentGateway->getUserDataStore()->generateFromArray($project->toArray());
$requestMessage = 'Thank you for supporting: ' . $paymentGateway->getUserDataStore()->getProductTitle();
$response = null;
try {
$response = $paymentGateway->requestPayment($amount, $requestMessage);
$this->view->checkoutEndpoint = $paymentGateway->getCheckoutEndpoint();
$this->view->paymentKey = $response->getPaymentId();
$this->_helper->viewRenderer->setRender('pay_' . $paymentProvider);
} catch (Exception $e) {
throw new Zend_Controller_Action_Exception('payment error', 500, $e);
}
if (false === $response->isSuccessful()) {
throw new Zend_Controller_Action_Exception('payment failure', 500);
}
if (empty($this->_authMember->member_id) or ($hideIdentity == 1)) {
$memberId = 1;
} else {
$memberId = $this->_authMember->member_id;
}
//Add pling
$modelPlings = new Default_Model_DbTable_Plings();
$plingId = $modelPlings->createNewPlingFromResponse($response, $memberId, $project->project_id, $amount);
if (false == empty($comment)) {
$modelComments = new Default_Model_ProjectComments();
$dataComment = array(
'comment_type' => Default_Model_DbTable_Comments::COMMENT_TYPE_PLING,
'comment_target_id' => $project->project_id,
'comment_member_id' => $memberId,
'comment_pling_id' => $plingId,
'comment_text' => $comment
);
$modelComments->save($dataComment);
}
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $memberId, Default_Model_ActivityLog::PROJECT_PLINGED,
$project->toArray());
}
/**
* @param string $paymentProvider
*
* @return Local_Payment_GatewayInterface
* @throws Exception
* @throws Local_Payment_Exception
* @throws Zend_Controller_Exception
* @throws Zend_Exception
*/
protected function createPaymentGateway($paymentProvider)
{
$httpHost = $this->getRequest()->getHttpHost();
/** @var Zend_Config $config */
$config = Zend_Registry::get('config');
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
switch ($paymentProvider) {
case 'paypal':
$paymentGateway = new Default_Model_PayPal_Gateway($config->third_party->paypal);
$paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/paypal');
// $paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/paypal?XDEBUG_SESSION_START=1');
$paymentGateway->setCancelUrl($helperBuildProductUrl->buildProductUrl($this->_projectId,
'paymentcancel', null, true));
$paymentGateway->setReturnUrl($helperBuildProductUrl->buildProductUrl($this->_projectId, 'paymentok',
null, true));
break;
case 'dwolla':
$paymentGateway = new Default_Model_Dwolla_Gateway($config->third_party->dwolla);
$paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/dwolla');
// $paymentGateway->setIpnNotificationUrl('http://' . $_SERVER ['HTTP_HOST'] . '/gateway/dwolla?XDEBUG_SESSION_START=1');
$paymentGateway->setReturnUrl($helperBuildProductUrl->buildProductUrl($this->_projectId, 'dwolla', null,
true));
break;
case 'amazon':
$paymentGateway = new Default_Model_Amazon_Gateway($config->third_party->amazon);
$paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/amazon');
// $paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/amazon?XDEBUG_SESSION_START=1');
$paymentGateway->setCancelUrl($helperBuildProductUrl->buildProductUrl($this->_projectId,
'paymentcancel', null, true));
$paymentGateway->setReturnUrl($helperBuildProductUrl->buildProductUrl($this->_projectId, 'paymentok',
null, true));
break;
default:
throw new Zend_Controller_Exception('No known payment provider found in parameters.');
break;
}
return $paymentGateway;
}
public function dwollaAction()
{
$modelPling = new Default_Model_DbTable_Plings();
$plingData = $modelPling->fetchRow(array('payment_reference_key = ?' => $this->getParam('checkoutId')));
$plingData->payment_transaction_id = (int)$this->getParam('transaction');
$plingData->save();
if ($this->_getParam('status') == 'Completed') {
$this->_helper->viewRenderer('paymentok');
$this->paymentokAction();
} else {
$this->_helper->viewRenderer('paymentcancel');
$this->paymentcancelAction();
}
}
public function paymentokAction()
{
$this->_helper->layout()->disableLayout();
$this->view->paymentStatus = 'success';
$this->view->paymentMessage = 'Payment successful.';
$this->fetchDataForIndexView();
}
public function paymentcancelAction()
{
$this->_helper->layout()->disableLayout();
$this->view->paymentStatus = 'danger';
$this->view->paymentMessage = 'Payment cancelled.';
$this->fetchDataForIndexView();
}
public function deleteAction()
{
$this->_helper->layout()->setLayout('flat_ui');
$memberId = (int)$this->getParam('m');
if ((empty($this->_authMember->member_id)) OR (empty($memberId)) OR ($this->_authMember->member_id
!= $memberId)
) {
$this->forward('products', 'user', 'default');
return;
}
$tableProduct = new Default_Model_Project();
$tableProduct->setDeleted($this->_authMember->member_id,$this->_projectId);
$product = $tableProduct->find($this->_projectId)->current();
// delete product from search index
$modelSearch = new Default_Model_Search_Lucene();
$modelSearch->deleteDocument($product->toArray());
// $command = new Backend_Commands_DeleteProductExtended($product);
// $command->doCommand();
// $queue = Local_Queue_Factory::getQueue('search');
// $command = new Backend_Commands_DeleteProductFromIndex($product->project_id, $product->project_category_id);
// $msg = $queue->send(serialize($command));
// ppload
// Delete collection
if ($product->ppload_collection_id) {
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
$collectionResponse = $pploadApi->deleteCollection($product->ppload_collection_id);
}
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_DELETED,
$product->toArray());
$this->forward('products', 'user', 'default');
}
public function unpublishAction()
{
$this->_helper->layout()->setLayout('flat_ui');
$memberId = (int)$this->getParam('m');
if (
(empty($this->_authMember->member_id))
OR
(empty($memberId))
OR ($this->_authMember->member_id != $memberId)
) {
return;
}
$tableProduct = new Default_Model_Project();
$tableProduct->setInActive($this->_projectId, $memberId);
$product = $tableProduct->find($this->_projectId)->current();
if (isset($product->type_id) && $product->type_id == Default_Model_Project::PROJECT_TYPE_UPDATE) {
$parentProduct = $tableProduct->find($product->pid)->current();
$product->image_small = $parentProduct->image_small;
}
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_UNPUBLISHED,
$product->toArray());
// remove unpublished project from search index
$modelSearch = new Default_Model_Search_Lucene();
$modelSearch->deleteDocument($product);
// ppload
if ($product->ppload_collection_id) {
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
// Update collection information
$collectionRequest = array(
'category' => $product->project_category_id
);
$collectionResponse = $pploadApi->putCollection($product->ppload_collection_id, $collectionRequest);
}
$this->forward('products', 'user', 'default', array('member_id' => $memberId));
//$this->redirect('/member/'.$memberId.'/products');
}
public function publishAction()
{
$memberId = (int)$this->getParam('m');
if ((empty($this->_authMember->member_id)) OR (empty($memberId)) OR ($this->_authMember->member_id
!= $memberId)
) {
return;
}
$tableProduct = new Default_Model_Project();
$tableProduct->setActive($this->_authMember->member_id,$this->_projectId);
$product = $tableProduct->find($this->_projectId)->current();
if (isset($product->type_id) && $product->type_id == Default_Model_Project::PROJECT_TYPE_UPDATE) {
$parentProduct = $tableProduct->find($product->pid)->current();
$product->image_small = $parentProduct->image_small;
}
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_PUBLISHED,
$product->toArray());
// add published project to search index
// $productInfo = $tableProduct->fetchProductInfo($this->_projectId);
// $modelSearch = new Default_Model_Search_Lucene();
// $modelSearch->addDocument($productInfo);
// ppload
if ($product->ppload_collection_id) {
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
// Update collection information
$collectionRequest = array(
'category' => $product->project_category_id . '-published'
);
$collectionResponse = $pploadApi->putCollection($product->ppload_collection_id, $collectionRequest);
}
$this->forward('products', 'user', 'default', array('member_id' => $memberId));
//$this->redirect('/member/'.$memberId.'/products');
}
public function loadratingsAction()
{
$this->_helper->layout->disableLayout();
$tableProjectRatings = new Default_Model_DbTable_ProjectRating();
$ratings = $tableProjectRatings->fetchRating($this->_projectId);
$this->_helper->json($ratings);
}
public function loadfilesjsonAction()
{
$this->_helper->layout->disableLayout();
// $project_id = $this->getParam('pid');
$modelProject = new Default_Model_Project();
$files = $modelProject->fetchFilesForProject($this->_projectId);
$salt = PPLOAD_DOWNLOAD_SECRET;
foreach ($files as &$file) {
$timestamp = time() + 3600; // one hour valid
$hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying
$url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp;
if(null != $this->_authMember) {
$url .= '/u/' . $this->_authMember->member_id;
}
$url .= '/lt/filepreview/' . $file['name'];
$file['url'] = urlencode($url);
}
$this->_helper->json($files);
}
public function loadfirstfilejsonAction()
{
$this->_helper->layout->disableLayout();
// $project_id = $this->getParam('pid');
$modelProject = new Default_Model_Project();
$files = $modelProject->fetchFilesForProject($this->_projectId);
$salt = PPLOAD_DOWNLOAD_SECRET;
$file = $files[0];
$timestamp = time() + 3600; // one hour valid
$hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying
$url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp;
if(null != $this->_authMember) {
$url .= '/u/' . $this->_authMember->member_id;
}
$url .= '/lt/filepreview/' . $file['name'];
$file['url'] = urlencode($url);
$this->_helper->json($file);
}
public function loadinstallinstructionAction()
{
$this->_helper->layout->disableLayout();
$infomodel = new Default_Model_Info();
$text = $infomodel->getOCSInstallInstruction();
$this->_helper->json(array(
'status' => 'ok',
'data' => $text
));
}
public function followAction()
{
$this->_helper->layout()->disableLayout();
// $this->_helper->viewRenderer->setNoRender(true);
$this->view->project_id = $this->_projectId;
$this->view->authMember = $this->_authMember;
if (array_key_exists($this->_projectId, $this->_authMember->projects)) {
return;
}
$projectFollowTable = new Default_Model_DbTable_ProjectFollower();
$newVals = array('project_id' => $this->_projectId, 'member_id' => $this->_authMember->member_id);
$where = $projectFollowTable->select()->where('member_id = ?', $this->_authMember->member_id)
->where('project_id = ?', $this->_projectId, 'INTEGER')
;
$result = $projectFollowTable->fetchRow($where);
if (null === $result) {
$projectFollowTable->createRow($newVals)->save();
$tableProduct = new Default_Model_Project();
$product = $tableProduct->find($this->_projectId)->current();
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id,
Default_Model_ActivityLog::PROJECT_FOLLOWED, $product->toArray());
}
// ppload
//Add collection to favorite
// $projectTable = new Default_Model_DbTable_Project();
// $projectData = $projectTable->find($this->_projectId)->current();
// if ($projectData->ppload_collection_id) {
// $pploadApi = new Ppload_Api(array(
// 'apiUri' => PPLOAD_API_URI,
// 'clientId' => PPLOAD_CLIENT_ID,
// 'secret' => PPLOAD_SECRET
// ));
//
// $favoriteRequest = array(
// 'user_id' => $this->_authMember->member_id,
// 'collection_id' => $projectData->ppload_collection_id
// );
//
// $favoriteResponse = $pploadApi->postFavorite($favoriteRequest);
// }
}
public function unfollowAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer('follow');
$this->view->project_id = $this->_projectId;
$this->view->authMember = $this->_authMember;
$projectFollowTable = new Default_Model_DbTable_ProjectFollower();
$projectFollowTable->delete('member_id=' . $this->_authMember->member_id . ' AND project_id='
. $this->_projectId);
$tableProduct = new Default_Model_Project();
$product = $tableProduct->find($this->_projectId)->current();
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id,
Default_Model_ActivityLog::PROJECT_UNFOLLOWED, $product->toArray());
// ppload
// Delete collection from favorite
// $projectTable = new Default_Model_DbTable_Project();
// $projectData = $projectTable->find($this->_projectId)->current();
// if ($projectData->ppload_collection_id) {
// $pploadApi = new Ppload_Api(array(
// 'apiUri' => PPLOAD_API_URI,
// 'clientId' => PPLOAD_CLIENT_ID,
// 'secret' => PPLOAD_SECRET
// ));
//
// $favoriteRequest = array(
// 'user_id' => $this->_authMember->member_id,
// 'collection_id' => $projectData->ppload_collection_id
// );
//
// $favoriteResponse =
// $pploadApi->postFavorite($favoriteRequest); // This post call will retrieve existing favorite info
// if (!empty($favoriteResponse->favorite->id)) {
// $favoriteResponse = $pploadApi->deleteFavorite($favoriteResponse->favorite->id);
// }
// }
}
public function followpAction()
{
$this->_helper->layout()->disableLayout();
// $this->_helper->viewRenderer->setNoRender(true);
$this->view->project_id = $this->_projectId;
$this->view->authMember = $this->_authMember;
if (array_key_exists($this->_projectId, $this->_authMember->projects)) {
return;
}
$projectFollowTable = new Default_Model_DbTable_ProjectFollower();
$newVals = array('project_id' => $this->_projectId, 'member_id' => $this->_authMember->member_id);
$where = $projectFollowTable->select()->where('member_id = ?', $this->_authMember->member_id)
->where('project_id = ?', $this->_projectId, 'INTEGER')
;
$result = $projectFollowTable->fetchRow($where);
if (null === $result) {
$projectFollowTable->createRow($newVals)->save();
$tableProduct = new Default_Model_Project();
$product = $tableProduct->find($this->_projectId)->current();
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id,
Default_Model_ActivityLog::PROJECT_FOLLOWED, $product->toArray());
}
}
public function unfollowpAction()
{
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer('followp');
$this->view->project_id = $this->_projectId;
$this->view->authMember = $this->_authMember;
$projectFollowTable = new Default_Model_DbTable_ProjectFollower();
$projectFollowTable->delete('member_id=' . $this->_authMember->member_id . ' AND project_id='
. $this->_projectId);
$tableProduct = new Default_Model_Project();
$product = $tableProduct->find($this->_projectId)->current();
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id,
Default_Model_ActivityLog::PROJECT_UNFOLLOWED, $product->toArray());
}
protected function logActivity($logId)
{
$tableProduct = new Default_Model_Project();
$product = $tableProduct->find($this->_projectId)->current();
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id,
$logId, $product->toArray());
}
public function followprojectAction()
{
$this->_helper->layout()->disableLayout();
$this->view->project_id = $this->_projectId;
$this->view->authMember = $this->_authMember;
// not allow to pling himself
if (array_key_exists($this->_projectId, $this->_authMember->projects))
{
$this->_helper->json(array(
'status' => 'error',
'msg' => 'not allowed'
));
return;
}
$projectFollowTable = new Default_Model_DbTable_ProjectFollower();
$newVals = array('project_id' => $this->_projectId, 'member_id' => $this->_authMember->member_id);
$where = $projectFollowTable->select()->where('member_id = ?', $this->_authMember->member_id)
->where('project_id = ?', $this->_projectId, 'INTEGER') ;
$result = $projectFollowTable->fetchRow($where);
if (null === $result) {
$projectFollowTable->createRow($newVals)->save();
$this->logActivity(Default_Model_ActivityLog::PROJECT_FOLLOWED);
$cnt = $projectFollowTable->countForProject($this->_projectId);
$this->_helper->json(array(
'status' => 'ok',
'msg' => 'Success.',
'cnt' => $cnt,
'action' =>'insert'
));
}else{
$projectFollowTable->delete('member_id=' . $this->_authMember->member_id . ' AND project_id='
. $this->_projectId);
$this->logActivity(Default_Model_ActivityLog::PROJECT_UNFOLLOWED);
$cnt = $projectFollowTable->countForProject($this->_projectId);
$this->_helper->json(array(
'status' => 'ok',
'msg' => 'Success.',
'cnt' => $cnt,
'action' => 'delete'
));
}
}
public function plingprojectAction()
{
$this->_helper->layout()->disableLayout();
$this->view->project_id = $this->_projectId;
$this->view->authMember = $this->_authMember;
// not allow to pling himself
if (array_key_exists($this->_projectId, $this->_authMember->projects))
{
$this->_helper->json(array(
'status' => 'error',
'msg' => 'not allowed'
));
return;
}
// not allow to pling if not supporter
$helperIsSupporter = new Default_View_Helper_IsSupporter();
if(!$helperIsSupporter->isSupporter($this->_authMember->member_id))
{
$this->_helper->json(array(
'status' => 'error',
'msg' => 'become a supporter first please. '
));
return;
}
$projectplings = new Default_Model_ProjectPlings();
$newVals = array('project_id' => $this->_projectId, 'member_id' => $this->_authMember->member_id);
$sql = $projectplings->select()
->where('member_id = ?', $this->_authMember->member_id)
->where('is_deleted = ?',0)
->where('project_id = ?', $this->_projectId, 'INTEGER')
;
$result = $projectplings->fetchRow($sql);
if (null === $result) {
$projectplings->createRow($newVals)->save();
//$this->logActivity(Default_Model_ActivityLog::PROJECT_PLINGED_2);
$cnt = $projectplings->getPlingsAmount($this->_projectId);
$this->_helper->json(array(
'status' => 'ok',
'msg' => 'Success.',
'cnt' => $cnt,
'action' =>'insert'
));
}else{
// delete pling
$projectplings->setDelete($result->project_plings_id);
//$this->logActivity(Default_Model_ActivityLog::PROJECT_DISPLINGED_2);
$cnt = $projectplings->getPlingsAmount($this->_projectId);
$this->_helper->json(array(
'status' => 'ok',
'msg' => 'Success.',
'cnt' => $cnt,
'action' => 'delete'
));
}
}
/**
public function unplingprojectAction()
{
$this->_helper->layout()->disableLayout();
$projectplings = new Default_Model_ProjectPlings();
$pling = $projectplings->getPling($this->_projectId,$this->_authMember->member_id);
if($pling)
{
$projectplings->setDelete($pling->project_plings_id);
$cnt = count($projectplings->getPlings($this->_projectId));
$this->_helper->json(array(
'status' => 'ok',
'deleted' => $pling->project_plings_id,
'msg' => 'Success. ',
'cnt' => $cnt
));
$tableProduct = new Default_Model_Project();
$product = $tableProduct->find($this->_projectId)->current();
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id,
Default_Model_ActivityLog::PROJECT_DISPLINGED_2, $product->toArray());
}else{
$this->_helper->json(array(
'status' => 'error',
'msg' => 'not existing.'
));
}
}
**/
public function followsAction()
{
$projectFollowTable = new Default_Model_Member();
$memberId = $this->_authMember->member_id;
$this->view->productList = $projectFollowTable->fetchFollowedProjects($memberId);
$projectArray = $this->generateFollowedProjectsViewData($this->view->productList);
$this->view->productArray['followedProjects'] = $projectArray;
}
/**
* @param $list
*
* @return array
*/
protected function generateFollowedProjectsViewData($list)
{
$viewArray = array();
if (count($list) == 0) {
return $viewArray;
}
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
foreach ($list as $element) {
$arr = array();
$arr['id'] = $element->project_id;
$arr['name'] = $element->title;
$arr['image'] = $element->image_small;
$arr['url'] = $helperBuildProductUrl->buildProductUrl($element->project_id);
$arr['urlUnFollow'] = $helperBuildProductUrl->buildProductUrl($element->project_id, 'unfollow');
#$arr['showUrlUnFollow'] = $this->view->isMember;
$viewArray[] = $arr;
}
return $viewArray;
}
public function verifycodeAction()
{
$this->_helper->layout()->disableLayout();
if ($this->_request->isXmlHttpRequest()) {
$tabProject = new Default_Model_DbTable_Project();
$dataProject = $tabProject->find($this->_projectId)->current();
$this->createTaskWebsiteOwnerVerification($dataProject);
$this->view->message = 'Your product page is stored for validation.';
return;
}
$this->view->message = 'This service is not available at the moment. Please try again later.';
}
/**
* @throws Zend_Controller_Action_Exception
* @deprecated
*/
public function fetchAction()
{
$this->_helper->layout()->disableLayout();
if ($this->_request->isXmlHttpRequest()) {
$this->view->authMember = $this->_authMember;
$this->fetchDataForIndexView();
$tableProject = new Default_Model_Project();
$this->view->supporting = $tableProject->fetchProjectSupporterWithPlings($this->_projectId);
if (false === isset($this->view->product)) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
}
$helperUserIsOwner = new Default_View_Helper_UserIsOwner();
$helperIsProjectActive = new Default_View_Helper_IsProjectActive();
if ((false === $helperIsProjectActive->isProjectActive($this->view->product->project_status)) AND (false
=== $helperUserIsOwner->UserIsOwner($this->view->product->member_id))
) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
}
$tablePageViews = new Default_Model_DbTable_StatPageViews();
$tablePageViews->savePageView($this->_projectId, $this->getRequest()->getClientIp(),
$this->_authMember->member_id);
}
$this->_helper->json(get_object_vars($this->view));
}
public function claimAction()
{
$modelProduct = new Default_Model_Project();
$productInfo = $modelProduct->fetchProductInfo($this->_projectId);
if ($productInfo->claimable != Default_Model_Project::PROJECT_CLAIMABLE) {
throw new Zend_Controller_Action_Exception('Method not available', 404);
}
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
if (empty($productInfo->claimed_by_member)) {
$modelProduct->setClaimedByMember($this->_authMember->member_id, $this->_projectId);
$claimMail = new Default_Plugin_SendMail('tpl_mail_claim_product');
$claimMail->setTemplateVar('sender', $this->_authMember->mail);
$claimMail->setTemplateVar('productid', $productInfo->project_id);
$claimMail->setTemplateVar('producttitle', $productInfo->title);
$claimMail->setTemplateVar('userid', $this->_authMember->member_id);
$claimMail->setTemplateVar('username', $this->_authMember->username);
$claimMail->setTemplateVar('usermail', $this->_authMember->mail);
$claimMail->setReceiverMail(array('contact@opendesktop.org'));
$claimMail->send();
$claimMailConfirm = new Default_Plugin_SendMail('tpl_mail_claim_confirm');
$claimMailConfirm->setTemplateVar('sender', 'contact@opendesktop.org');
$claimMailConfirm->setTemplateVar('producttitle', $productInfo->title);
$claimMailConfirm->setTemplateVar('productlink', 'http://' . $this->getRequest()->getHttpHost()
. $helperBuildProductUrl->buildProductUrl($productInfo->project_id));
$claimMailConfirm->setTemplateVar('username', $this->_authMember->username);
$claimMailConfirm->setReceiverMail($this->_authMember->mail);
$claimMailConfirm->send();
}
$this->_helper->viewRenderer('index');
$this->indexAction();
}
public function makerconfigAction()
{
$this->_helper->layout()->disableLayout();
$widgetProjectId = (int)$this->getParam('project_id');
if (false == isset($widgetProjectId)) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
}
$widgetDefaultModel = new Default_Model_DbTable_ProjectWidgetDefault();
$widgetDefault = $widgetDefaultModel->fetchConfig($widgetProjectId);
if (!isset($widgetDefault)) {
throw new Zend_Controller_Action_Exception('This page does not exist', 404);
} else {
$this->view->widgetConfig = $widgetDefault;
$productModel = new Default_Model_Project();
$this->view->product = $productModel->fetchProductDataFromMV($widgetProjectId);
$this->view->supporting = $productModel->fetchProjectSupporterWithPlings($widgetProjectId);
$plingModel = new Default_Model_DbTable_Plings();
$this->view->comments = $plingModel->getCommentsForProject($widgetProjectId, 10);
$websiteOwner = new Local_Verification_WebsiteProject();
$this->view->authCode = ' ';
}
}
/**
* ppload
*/
public function addpploadfileAction()
{
$this->_helper->layout()->disableLayout();
$log = Zend_Registry::get('logger');
$log->debug('**********' . __CLASS__ . '::' . __FUNCTION__ . '**********' . "\n");
$projectTable = new Default_Model_DbTable_Project();
$projectData = $projectTable->find($this->_projectId)->current();
$error_text = '';
// Add file to ppload collection
if (!empty($_FILES['file_upload']['tmp_name'])
&& $_FILES['file_upload']['error'] == UPLOAD_ERR_OK
) {
$tmpFilename = dirname($_FILES['file_upload']['tmp_name']) . '/' . basename($_FILES['file_upload']['name']);
$log->debug(__CLASS__ . '::' . __FUNCTION__ . '::' . print_r($tmpFilename, true) . "\n");
move_uploaded_file($_FILES['file_upload']['tmp_name'], $tmpFilename);
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
$fileRequest = array(
'file' => $tmpFilename,
'owner_id' => $this->_authMember->member_id
);
//Admins can upload files for users
$helperUserRole = new Backend_View_Helper_UserRole();
$userRoleName = $helperUserRole->userRole();
if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) {
$member_id = $projectData->member_id;
$fileRequest = array(
'file' => $tmpFilename,
'owner_id' => $member_id
);
}
if ($projectData->ppload_collection_id) {
// Append to existing collection
$fileRequest['collection_id'] = $projectData->ppload_collection_id;
}
//if (isset($_POST['file_description'])) {
// $fileRequest['description'] = mb_substr($_POST['file_description'], 0, 140);
//}
$fileResponse = $pploadApi->postFile($fileRequest);
$log->debug(__CLASS__ . '::' . __FUNCTION__ . '::' . print_r($fileResponse, true) . "\n");
unlink($tmpFilename);
if (!empty($fileResponse->file->collection_id)) {
if (!$projectData->ppload_collection_id) {
// Save collection ID
$projectData->ppload_collection_id = $fileResponse->file->collection_id;
//20180219 ronald: we set the changed_at only by new files or new updates
if((int)$this->_authMember->member_id==(int)$projectData->member_id)
{
$projectData->changed_at = new Zend_Db_Expr('NOW()');
} else {
$log->info('********** ' . __CLASS__ . '::' . __FUNCTION__ . ' Project ChangedAt is not set: Auth-Member ('.$this->_authMember->member_id.') != Project-Owner ('.$projectData->member_id.'): **********' . "\n");
}
$projectData->ghns_excluded = 0;
$projectData->save();
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog($this->_projectId, $projectData->member_id,
Default_Model_ActivityLog::PROJECT_EDITED, $projectData->toArray());
// Update profile information
$memberTable = new Default_Model_DbTable_Member();
$memberSettings = $memberTable->find($this->_authMember->member_id)->current();
$mainproject = $projectTable->find($memberSettings->main_project_id)->current();
$profileName = '';
if ($memberSettings->firstname
|| $memberSettings->lastname
) {
$profileName = trim($memberSettings->firstname . ' ' . $memberSettings->lastname);
} else {
if ($memberSettings->username) {
$profileName = $memberSettings->username;
}
}
$profileRequest = array(
'owner_id' => $this->_authMember->member_id,
'name' => $profileName,
'email' => $memberSettings->mail,
'homepage' => $memberSettings->link_website,
'description' => $mainproject->description
);
$profileResponse = $pploadApi->postProfile($profileRequest);
// Update collection information
$collectionCategory = $projectData->project_category_id;
if (Default_Model_Project::PROJECT_ACTIVE == $projectData->status) {
$collectionCategory .= '-published';
}
$collectionRequest = array(
'title' => $projectData->title,
'description' => $projectData->description,
'category' => $collectionCategory,
'content_id' => $projectData->project_id
);
$collectionResponse =
$pploadApi->putCollection($projectData->ppload_collection_id, $collectionRequest);
// Store product image as collection thumbnail
$this->_updatePploadMediaCollectionthumbnail($projectData);
} else {
//20180219 ronald: we set the changed_at only by new files or new updates
if((int)$this->_authMember->member_id==(int)$projectData->member_id)
{
$projectData->changed_at = new Zend_Db_Expr('NOW()');
} else {
$log->info('********** ' . __CLASS__ . '::' . __FUNCTION__ . ' Project ChangedAt is not set: Auth-Member ('.$this->_authMember->member_id.') != Project-Owner ('.$projectData->member_id.'): **********' . "\n");
}
$projectData->ghns_excluded = 0;
$projectData->save();
}
//If this file is a video, we have to convert it for preview
if(!empty($fileResponse->file->type) && in_array($fileResponse->file->type, Backend_Commands_ConvertVideo::$VIDEO_FILE_TYPES)) {
$queue = Local_Queue_Factory::getQueue();
$command = new Backend_Commands_ConvertVideo($projectData->ppload_collection_id, $fileResponse->file->id, $fileResponse->file->type);
$queue->send(serialize($command));
}
$this->_helper->json(array(
'status' => 'ok',
'file' => $fileResponse->file
));
return;
}
}
$log->debug('********** END ' . __CLASS__ . '::' . __FUNCTION__ . '**********' . "\n");
$this->_helper->json(array('status' => 'error', 'error_text' => $error_text));
}
/**
* ppload
*/
public function updatepploadfileAction()
{
$this->_helper->layout()->disableLayout();
$log = Zend_Registry::get('logger');
$log->debug('**********' . __CLASS__ . '::' . __FUNCTION__ . '**********' . "\n");
$projectTable = new Default_Model_DbTable_Project();
$projectData = $projectTable->find($this->_projectId)->current();
$error_text = '';
// Update a file in ppload collection
if (!empty($_POST['file_id'])) {
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
$fileResponse = $pploadApi->getFile($_POST['file_id']);
if (isset($fileResponse->file->collection_id)
&& $fileResponse->file->collection_id == $projectData->ppload_collection_id
) {
$fileRequest = array();
$tmpFilename = '';
if (!empty($_FILES['file_upload']['tmp_name'])
&& $_FILES['file_upload']['error'] == UPLOAD_ERR_OK
) {
$tmpFilename = dirname($_FILES['file_upload']['tmp_name']) . '/' . basename($_FILES['file_upload']['name']);
$log->debug(__CLASS__ . '::' . __FUNCTION__ . '::' . print_r($tmpFilename, true) . "\n");
move_uploaded_file($_FILES['file_upload']['tmp_name'], $tmpFilename);
$fileRequest['file'] = $tmpFilename;
//20180219 ronald: we set the changed_at only by new files or new updates
if((int)$this->_authMember->member_id==(int)$projectData->member_id)
{
$projectData->changed_at = new Zend_Db_Expr('NOW()');
} else {
$log->info('********** ' . __CLASS__ . '::' . __FUNCTION__ . ' Project ChangedAt is not set: Auth-Member ('.$this->_authMember->member_id.') != Project-Owner ('.$projectData->member_id.'): **********' . "\n");
}
$projectData->ghns_excluded = 0;
$projectData->save();
}
if (isset($_POST['file_description'])) {
$fileRequest['description'] = mb_substr($_POST['file_description'], 0, 140);
}
if (isset($_POST['file_category'])) {
$fileRequest['category'] = $_POST['file_category'];
}
if (isset($_POST['file_tags'])) {
$fileRequest['tags'] = $_POST['file_tags'];
}
if (isset($_POST['ocs_compatible'])) {
$fileRequest['ocs_compatible'] = $_POST['ocs_compatible'];
}
if (isset($_POST['file_version'])) {
$fileRequest['version'] = $_POST['file_version'];
}
$fileResponse = $pploadApi->putFile($_POST['file_id'], $fileRequest);
$log->debug(__CLASS__ . '::' . __FUNCTION__ . '::' . print_r($fileResponse, true) . "\n");
if ($tmpFilename) {
unlink($tmpFilename);
}
if (isset($fileResponse->status)
&& $fileResponse->status == 'success'
) {
$this->_helper->json(array(
'status' => 'ok',
'file' => $fileResponse->file
));
return;
} else {
$error_text .= 'Response: $pploadApi->putFile(): ' . json_encode($fileResponse)
. '; $fileResponse->status: ' . $fileResponse->status;
}
} else {
$error_text .= 'PPload Response: ' . json_encode($fileResponse)
. '; fileResponse->file->collection_id: ' . $fileResponse->file->collection_id
. ' != $projectData->ppload_collection_id: ' . $projectData->ppload_collection_id;
}
} else {
$error_text .= 'No CollectionId or no FileId. CollectionId: ' . $projectData->ppload_collection_id
. ', FileId: ' . $_POST['file_id'];
}
$log->debug('********** END ' . __CLASS__ . '::' . __FUNCTION__ . '**********' . "\n");
$this->_helper->json(array('status' => 'error', 'error_text' => $error_text));
}
public function updatefiletagAction()
{
$this->_helper->layout()->disableLayout();
$error_text = '';
// Update a file information in ppload collection
if (!empty($_POST['file_id'])) {
$tagId = null;
if (isset($_POST['tag_id'])) {
$tagId = $_POST['tag_id'];
}
$tagGroupId = null;
if (isset($_POST['tag_group_id'])) {
$tagGroupId = $_POST['tag_group_id'];
}
//set architecture
$modelTags = new Default_Model_Tags();
$modelTags->saveFileTagForProjectAndTagGroup($this->_projectId, $_POST['file_id'], $tagId, $tagGroupId);
$this->_helper->json(array('status' => 'ok'));
return;
} else {
$error_text .= 'No FileId. , FileId: ' . $_POST['file_id'];
}
$this->_helper->json(array('status' => 'error', 'error_text' => $error_text));
}
public function deletefiletagAction()
{
$this->_helper->layout()->disableLayout();
$error_text = '';
// Update a file information in ppload collection
if (!empty($_POST['file_id'])) {
$tagId = null;
if (isset($_POST['tag_id'])) {
$tagId = $_POST['tag_id'];
}
//set architecture
$modelTags = new Default_Model_Tags();
$modelTags->deleteFileTagForProject($this->_projectId, $_POST['file_id'], $tagId);
$this->_helper->json(array('status' => 'ok'));
return;
} else {
$error_text .= 'No FileId. , FileId: ' . $_POST['file_id'];
}
$this->_helper->json(array('status' => 'error', 'error_text' => $error_text));
}
public function updatecompatibleAction()
{
$this->_helper->layout()->disableLayout();
$error_text = '';
// Update a file information in ppload collection
if (!empty($_POST['file_id'])) {
$typeId = null;
if (isset($_POST['is_compatible'])) {
$is_compatible = $_POST['is_compatible'];
}
return;
} else {
$error_text .= 'No FileId. , FileId: ' . $_POST['file_id'];
}
$this->_helper->json(array('status' => 'error', 'error_text' => $error_text));
}
public function startdownloadAction() {
$this->_helper->layout()->disableLayout();
/**
* Save Download-Data in Member_Download_History
*/
$file_id = $this->getParam('file_id');
$file_type = $this->getParam('file_type');
$file_name = $this->getParam('file_name');
$file_size = $this->getParam('file_size');
$projectId = $this->_projectId;
$this->redirect('/dl?file_id='.$file_id.'&file_type='.$file_type.'&file_name='.$file_name.'&file_size='.$file_size.'&project_id='.$projectId);
// if ($_SERVER['REQUEST_METHOD'] == 'POST') {
/* if(isset($file_id) && isset($projectId) && isset($memberId)) {
$memberDlHistory = new Default_Model_DbTable_MemberDownloadHistory();
$data = array('project_id' => $projectId, 'member_id' => $memberId, 'file_id' => $file_id, 'file_type' => $file_type, 'file_name' => $file_name, 'file_size' => $file_size);
$memberDlHistory->createRow($data)->save();
}
$url = urldecode($urltring);
$this->redirect($url);
*
*/
// } else {
// $this->redirect('/ads?file_id='.$file_id);
// }
}
/**
* ppload
*/
public function deletepploadfileAction()
{
$this->_helper->layout()->disableLayout();
$projectTable = new Default_Model_DbTable_Project();
$projectData = $projectTable->find($this->_projectId)->current();
$error_text = '';
// Delete file from ppload collection
if (!empty($_POST['file_id'])) {
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
$fileResponse = $pploadApi->getFile($_POST['file_id']);
if (isset($fileResponse->file->collection_id)
&& $fileResponse->file->collection_id == $projectData->ppload_collection_id
) {
$fileResponse = $pploadApi->deleteFile($_POST['file_id']);
if (isset($fileResponse->status)
&& $fileResponse->status == 'success'
) {
$this->_helper->json(array('status' => 'ok'));
return;
} else {
$error_text .= 'Response: $pploadApi->putFile(): ' . json_encode($fileResponse);
}
}
}
$this->_helper->json(array('status' => 'error', 'error_text' => $error_text));
}
/**
* ppload
*/
public function deletepploadfilesAction()
{
$this->_helper->layout()->disableLayout();
$projectTable = new Default_Model_DbTable_Project();
$projectData = $projectTable->find($this->_projectId)->current();
// Delete all files in ppload collection
if ($projectData->ppload_collection_id) {
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
$filesRequest = array(
'collection_id' => $projectData->ppload_collection_id,
'perpage' => 1000
);
$filesResponse = $pploadApi->getFiles($filesRequest);
if (isset($filesResponse->status)
&& $filesResponse->status == 'success'
) {
foreach ($filesResponse->files as $file) {
$fileResponse = $pploadApi->deleteFile($file->id);
if (!isset($fileResponse->status)
|| $fileResponse->status != 'success'
) {
$this->_helper->json(array('status' => 'error'));
return;
}
}
}
$this->_helper->json(array('status' => 'ok'));
return;
}
$this->_helper->json(array('status' => 'error'));
}
/**
* ppload
*/
/*public function deletepploadcollectionAction()
{
$this->_helper->layout()->disableLayout();
$projectTable = new Default_Model_DbTable_Project();
$projectData = $projectTable->find($this->_projectId)->current();
// Delete ppload collection
if ($projectData->ppload_collection_id) {
$pploadApi = new Ppload_Api(array(
'apiUri' => PPLOAD_API_URI,
'clientId' => PPLOAD_CLIENT_ID,
'secret' => PPLOAD_SECRET
));
$collectionResponse = $pploadApi->deleteCollection($projectData->ppload_collection_id);
if (isset($collectionResponse->status)
&& $collectionResponse->status == 'success'
) {
$projectData->ppload_collection_id = null;
$projectData->changed_at = new Zend_Db_Expr('NOW()');
$projectData->save();
$activityLog = new Default_Model_ActivityLog();
$activityLog->writeActivityLog(
$this->_projectId,
$projectData->member_id,
Default_Model_ActivityLog::PROJECT_EDITED,
$projectData->toArray()
);
$this->_helper->json(array('status' => 'ok'));
return;
}
}
$this->_helper->json(array('status' => 'error'));
}*/
public function saveproductAction()
{
$form = new Default_Form_Product();
// we don't need to test a file which doesn't exist in this case. The Framework stumbles if $_FILES is empty.
if ($this->_request->isXmlHttpRequest() AND (count($_FILES) == 0)) {
$form->removeElement('image_small_upload');
// $form->removeElement('image_big_upload');
$form->removeSubForm('gallery');
$form->removeElement('project_id'); //(workaround: Some Browsers send "0" in some cases.)
}
if (false === $form->isValid($_POST)) {
$errors = $form->getMessages();
$messages = $this->getErrorMessages($errors);
$this->_helper->json(array('status' => 'error', 'messages' => $messages));
}
$formValues = $form->getValues();
$formValues['status'] = Default_Model_Project::PROJECT_INCOMPLETE;
$modelProject = new Default_Model_Project();
$newProject =
$modelProject->createProject($this->_authMember->member_id, $formValues, $this->_authMember->username);
//$this->createSystemPlingForNewProject($newProject->project_id);
//New Project in Session, for AuthValidation (owner)
$this->_auth->getIdentity()->projects[$newProject->project_id] = array('project_id' => $newProject->project_id);
$this->_helper->json(array('status' => 'ok', 'project_id' => $newProject->project_id));
}
protected function createPling($member_id,$project_id)
{
$projectplings = new Default_Model_ProjectPlings();
$newVals = array('project_id' =>$project_id, 'member_id' => $member_id);
$sql = $projectplings->select()
->where('member_id = ?', $this->_authMember->member_id)
->where('is_deleted = ?',0)
->where('project_id = ?', $this->_projectId, 'INTEGER');
$result = $projectplings->fetchRow($sql);
if (null === $result) {
$projectplings->createRow($newVals)->save();
}
}
/**
* @param $errors
*
* @return array
*/
protected function getErrorMessages($errors)
{
$messages = array();
foreach ($errors as $element => $row) {
if (!empty($row) && $element != 'submit') {
foreach ($row as $validator => $message) {
$messages[$element][] = $message;
}
}
}
return $messages;
}
public function searchAction()
{
// Filter-Parameter
$params = $this->getAllParams();
$filterInput =
new Zend_Filter_Input(
array(
'*' => 'StringTrim',
'projectSearchText' => array(new Zend_Filter_Callback('stripslashes'),'StripTags'),
'page' => 'digits',
'pci' => 'digits',
'ls' => 'digits',
't' => array(new Zend_Filter_Callback('stripslashes'),'StripTags'),
'pkg'=> array(new Zend_Filter_Callback('stripslashes'),'StripTags'),
'lic'=> array(new Zend_Filter_Callback('stripslashes'),'StripTags'),
'arch'=> array(new Zend_Filter_Callback('stripslashes'),'StripTags')
),
array(
'projectSearchText' => array(
new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)),
'presence' => 'required'
),
'page' => array('digits', 'default' => '1'),
'f' => array(
new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)),
//new Zend_Validate_InArray(array('f'=>'tags')),
'allowEmpty' => true
),
'pci' => array('digits',
'allowEmpty' => true
),
'ls' => array('digits',
'allowEmpty' => true
),
't' => array(new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)),
'allowEmpty' => true
),
'pkg' => array(new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)),
'allowEmpty' => true
),
'lic' => array(new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)),
'allowEmpty' => true
),
'arch' => array(new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)),
'allowEmpty' => true)
), $params);
if ($filterInput->hasInvalid()) {
$this->_helper->flashMessenger->addMessage('There was an error. Please check your input and try again.
');
return;
}
$this->view->searchText = $filterInput->getEscaped('projectSearchText');
$this->view->page = $filterInput->getEscaped('page');
$this->view->searchField = $filterInput->getEscaped('f');
$this->view->pci = $filterInput->getEscaped('pci');
$this->view->ls = $filterInput->getEscaped('ls');
$this->view->t = $filterInput->getEscaped('t');
$this->view->pkg = $filterInput->getEscaped('pkg');
$this->view->arch = $filterInput->getEscaped('arch');
$this->view->lic = $filterInput->getEscaped('lic');
$this->view->store = $this->getParam('domain_store_id');
if(isset($params['isJson']))
{
$this->_helper->layout()->disableLayout();
$filterScore = $this->view->ls ? 'laplace_score:['.$this->view->ls.' TO '.($this->view->ls+9).']':null;
$filterCat = $this->view->pci ? 'project_category_id:('.$this->view->pci.')' : null;
$filterTags = $this->view->t ? 'tags:('.$this->view->t.')' : null;
$filterPkg = $this->view->pkg ? 'package_names:('.$this->view->pkg.')' : null;
$filterArch = $this->view->arch ? 'arch_names:('.$this->view->arch.')' : null;
$filterLic = $this->view->lic ? 'license_names:('.$this->view->lic.')' : null;
// $param = array('q' => $this->view->searchText ,'store'=>$this->view->store,'page' => $this->view->page
// , 'count' => 10, 'qf' => $this->view->searchField, 'fq' => array($filterCat, $filterScore, $filterTags,$filterPkg,$filterArch,$filterLic));
$param = array('q' => 'test','store'=>null,'page' => 1
, 'count' => 10);
$viewHelperImage = new Default_View_Helper_Image();
$modelSearch = new Default_Model_Solr();
try {
$result = $modelSearch->search($param);
$products = $result['hits'];
// var_dump($products);
// die;
$ps=array();
foreach ($products as $p) {
$img = $viewHelperImage->Image($p->image_small, array(
'width' => 50,
'height' => 50
));
$ps[] =array('description'=>$p->description
,'title' =>$p->title
,'project_id' =>$p->project_id
,'member_id'=>$p->member_id
,'username' => $p->username
,'laplace_score' =>$p->laplace_score
,'score' =>$p->score
,'image_small' =>$img);
}
$this->_helper->json(array(
'status' => 'ok',
'products' => $ps,
'q' =>$param
));
} catch (Exception $e) {
$this->_helper->json(array(
'status' => 'err',
'msg' => 'Not Found! Try again.'
));
}
}
}
/**
* @param $memberId
*
* @throws Zend_Db_Table_Exception
*/
protected function setViewDataForMyProducts($memberId)
{
$tableMember = new Default_Model_Member();
$this->view->member = $tableMember->find($memberId)->current();
$tableProduct = new Default_Model_Project();
$this->view->products = $tableProduct->fetchAllProjectsForMember($memberId);
}
protected function _initResponseHeader()
{
$duration = 1800; // in seconds
$expires = gmdate("D, d M Y H:i:s", time() + $duration) . " GMT";
$this->getResponse()->setHeader('X-FRAME-OPTIONS', 'ALLOWALL',
true)// ->setHeader('Last-Modified', $modifiedTime, true)
->setHeader('Expires', $expires, true)->setHeader('Pragma', 'no-cache', true)
->setHeader('Cache-Control', 'private, no-cache, must-revalidate', true)
;
}
/**
* @param $hits
*
* @return array
*/
protected function generateProjectsArrayForView($hits)
{
$viewArray = array();
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
/** @var $hit Zend_Search_Lucene_Search_QueryHit */
foreach ($hits as $hit) {
$project = $hit->getDocument();
if (null != $project->username) {
$isUpdate = ($project->type_id == 2);
if ($isUpdate) {
$showUrl =
$helperBuildProductUrl->buildProductUrl($project->pid) . '#anker_' . $project->project_id;
$plingUrl = $helperBuildProductUrl->buildProductUrl($project->pid, 'pling');
} else {
$showUrl = $helperBuildProductUrl->buildProductUrl($project->project_id);
$plingUrl = $helperBuildProductUrl->buildProductUrl($project->project_id, 'pling');
}
$projectArr = array(
'score' => $hit->score,
'id' => $project->project_id,
'type_id' => $project->type_id,
'title' => $project->title,
'description' => $project->description,
'image' => $project->image_small,
'plings' => 0,
'urlGoal' => $showUrl,
'urlPling' => $plingUrl,
'showUrlPling' => ($project->paypal_mail != null),
'member' => array(
'name' => $project->username,
'url' => 'member/' . $project->member_id,
'image' => $project->profile_image_url,
'id' => $project->member_id
)
);
$viewArray[] = $projectArr;
}
}
return $viewArray;
}
protected function setLayout()
{
$layoutName = 'flat_ui_template';
$storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null;
if($storeConfig && $storeConfig->layout_pagedetail)
{
$this->_helper->layout()->setLayout($storeConfig->layout_pagedetail);
}else{
$this->_helper->layout()->setLayout($layoutName);
}
}
private function fetchGitlabProject($gitProjectId)
{
$gitlab = new Default_Model_Ocs_Gitlab();
try {
$gitProject = $gitlab->getProject($gitProjectId);
} catch (Exception $exc) {
//Project is gone
$modelProject = new Default_Model_Project();
$modelProject->updateProject($this->_projectId, array('is_gitlab_project' => 0, 'gitlab_project_id' => null, 'show_gitlab_project_issues' => 0, 'use_gitlab_project_readme' => 0));
$gitProject = null;
}
return $gitProject;
}
private function fetchGitlabProjectIssues($gitProjectId)
{
$gitlab = new Default_Model_Ocs_Gitlab();
try {
$gitProjectIssues = $gitlab->getProjectIssues($gitProjectId);
} catch (Exception $exc) {
//Project is gone
$modelProject = new Default_Model_Project();
$modelProject->updateProject($this->_projectId, array('is_gitlab_project' => 0, 'gitlab_project_id' => null, 'show_gitlab_project_issues' => 0, 'use_gitlab_project_readme' => 0));
$gitProjectIssues = null;
}
return $gitProjectIssues;
}
public function startmediaviewajaxAction() {
return $this->startvideoajaxAction();
}
public function startvideoajaxAction() {
$this->_helper->layout()->disableLayout();
$collection_id = null;
$file_id = null;
$memberId = $this->_authMember->member_id;
$media_view_type_id = $this->getParam('type_id');
if(!$media_view_type_id)
{
// default
$media_view_type_id = Default_Model_DbTable_MediaViews::MEDIA_TYPE_VIDEO;
}
if($this->hasParam('collection_id') && $this->hasParam('file_id')) {
$collection_id = $this->getParam('collection_id');
$file_id = $this->getParam('file_id');
$id = null;
//Log media view
try {
$mediaviewsTable = new Default_Model_DbTable_MediaViews();
$id = $mediaviewsTable->getNewId();
$data = array('media_view_id' => $id, 'media_view_type_id' => $media_view_type_id, 'project_id' => $this->_projectId, 'collection_id' => $collection_id, 'file_id' => $file_id, 'start_timestamp' => new Zend_Db_Expr ('Now()'), 'ip' => $this->getRealIpAddr(), 'referer' => $this->getReferer());
if(!empty($memberId)) {
$data['member_id'] = $memberId;
}
$data['source'] = 'OCS-Webserver';
$mediaviewsTable->createRow($data)->save();
} catch (Exception $exc) {
//echo $exc->getTraceAsString();
$errorLog = Zend_Registry::get('logger');
$errorLog->err(__METHOD__ . ' - ' . $exc->getMessage() . ' ---------- ' . PHP_EOL);
}
$this->_helper->json(array('status' => 'success', 'MediaViewId' => $id));
return;
}
$this->_helper->json(array('status' => 'error'));
}
public function stopmediaviewajaxAction() {
return $this->stopvideoajaxAction();
}
public function stopvideoajaxAction() {
$this->_helper->layout()->disableLayout();
$view_id = null;
if($this->hasParam('media_view_id')) {
$view_id = $this->getParam('media_view_id');
//Log media view stop
try {
$mediaviewsTable = new Default_Model_DbTable_MediaViews();
$data = array('stop_timestamp' => new Zend_Db_Expr ('Now()'));
$mediaviewsTable->update($data, 'media_view_id = '. $view_id);
} catch (Exception $exc) {
//echo $exc->getTraceAsString();
$errorLog = Zend_Registry::get('logger');
$errorLog->err(__METHOD__ . ' - ' . $exc->getMessage() . ' ---------- ' . PHP_EOL);
}
$this->_helper->json(array('status' => 'success', 'MediaViewId' => $view_id));
return;
}
$this->_helper->json(array('status' => 'error'));
}
function getRealIpAddr()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
function getReferer()
{
$referer = null;
if (!empty($_SERVER['HTTP_REFERER'])) {
$referer = $_SERVER['HTTP_REFERER'];
}
return $referer;
}
}
diff --git a/application/modules/default/controllers/SupportersController.php b/application/modules/default/controllers/SupportersController.php
index c4c2f745a..4fa0a29a2 100755
--- a/application/modules/default/controllers/SupportersController.php
+++ b/application/modules/default/controllers/SupportersController.php
@@ -1,171 +1,171 @@
.
**/
class SupportersController extends Local_Controller_Action_DomainSwitch
{
public function indexAction()
{
- $section_id = $this->getParam('id',null);
+ $section_id = $this->getParam('id',2);
$products = self::fetchProducts($section_id);
$creators = self::fetchCreators($section_id);
$supporters = self::fetchSupporters($section_id);
$model = new Default_Model_Section();
$section = null;
if($section_id)
{
$section = $model->fetchSection($section_id);
$this->view->section = $section;
$this->view->section_id = $section_id;
}
$this->view->supporters = $supporters;
$this->view->products = $products;
$this->view->creators = $creators;
$title = 'Section';
if($section){
$title = 'Section '.$section['name'];
}
$this->view->headTitle($title . ' - ' . $this->getHeadTitle(), 'SET');
}
public function topAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$section_id = $this->getParam('id',null);
$products = self::fetchProducts($section_id);
$creators = self::fetchCreators($section_id);
$this->_helper->json(array('status' => 'ok', 'products' => $products,'creators' => $creators));
}
public function fetchCreators($section_id)
{
$model = new Default_Model_Section();
$helpPrintDate = new Default_View_Helper_PrintDate();
$helperImage = new Default_View_Helper_Image();
$creators = $model->fetchTopPlingedCreatorPerSection($section_id);
foreach ($creators as &$p) {
$p['profile_image_url'] = $helperImage->Image($p['profile_image_url'], array('width' => 100, 'height' => 100));
}
return $creators;
}
public function fetchProducts($section_id)
{
$model = new Default_Model_Section();
$helpPrintDate = new Default_View_Helper_PrintDate();
$helperImage = new Default_View_Helper_Image();
$products=$model->fetchTopPlingedProductsPerSection($section_id);
foreach ($products as &$p) {
$p['image_small'] = $helperImage->Image($p['image_small'], array('width' => 200, 'height' => 200));
$p['updated_at'] = $helpPrintDate->printDate(($p['changed_at']==null?$p['created_at']:$p['changed_at']));
}
return $products;
}
public function fetchSupporters($section_id)
{
$info = new Default_Model_Info();
$helperImage = new Default_View_Helper_Image();
if($section_id)
{
$supporters = $info->getNewActiveSupportersForSection($section_id,1000);
}else{
$supporters = $info->getNewActiveSupportersForSectionAll(1000);
}
$s= array();
foreach ($supporters as &$p) {
$s[] = array('profile_image_url' => $helperImage->Image($p['profile_image_url'], array('width' => 100, 'height' => 100)),
'member_id' => $p['member_id'],
'username' => $p['username'],
'section_support_tier' => $p['section_support_tier']
);
/*$p['profile_image_url'] = $helperImage->Image($p['profile_image_url'], array('width' => 100, 'height' => 100));*/
}
return $s;
}
public function topcatAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$model = new Default_Model_Section();
$helpPrintDate = new Default_View_Helper_PrintDate();
$helperImage = new Default_View_Helper_Image();
$cat_id = $this->getParam('cat_id');
$products=$model->fetchTopPlingedProductsPerCategory($cat_id);
foreach ($products as &$p) {
$p['image_small'] = $helperImage->Image($p['image_small'], array('width' => 200, 'height' => 200));
$p['updated_at'] = $helpPrintDate->printDate(($p['changed_at']==null?$p['created_at']:$p['changed_at']));
}
$creators = $model->fetchTopPlingedCreatorPerCategory($cat_id);
foreach ($creators as &$p) {
$p['profile_image_url'] = $helperImage->Image($p['profile_image_url'], array('width' => 100, 'height' => 100));
}
$this->_helper->json(array('status' => 'ok', 'cat_id'=>$cat_id,'products' => $products,'creators' => $creators));
}
public function recentplingsAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
$section_id = $this->getParam('id',null);
$model = new Default_Model_Section();
$helpPrintDate = new Default_View_Helper_PrintDate();
$helperImage = new Default_View_Helper_Image();
$products=$model->getNewActivePlingProduct($section_id);
foreach ($products as &$p) {
$p['image_small'] = $helperImage->Image($p['image_small'],array('width' => '115', 'height' => '75', 'crop' => 2));
$p['created_at'] = $helpPrintDate->printDate($p['created_at']);
$p['profile_image_url'] = $helperImage->Image($p['profile_image_url'], array('width' => 100, 'height' => 100));
}
$this->_helper->json(array('status' => 'ok', 'products' => $products));
}
protected function setLayout()
{
$this->_helper->layout()->setLayout('layout_pling_home');
}
}
diff --git a/application/modules/default/models/ProjectClone.php b/application/modules/default/models/ProjectClone.php
index 8e557078f..9193c5ec5 100755
--- a/application/modules/default/models/ProjectClone.php
+++ b/application/modules/default/models/ProjectClone.php
@@ -1,175 +1,233 @@
.
**/
class Default_Model_ProjectClone extends Default_Model_DbTable_ProjectClone
{
public function fetchOrigins($project_id)
{
$sql = "
SELECT
c.project_id as project_id_clone
,c.project_id_parent as project_id
,c.external_link
,c.member_id
,c.text
,' ' as catTitle
,p.project_category_id
,p.title
,p.image_small
,p.changed_at
FROM project_clone c
JOIN project p ON p.project_id = c.project_id_parent
WHERE c.is_deleted = 0 and c.is_valid = 1 and c.project_id = :project_id
AND p.`status` = 100
order by c.created_at desc
";
$resultSet = $this->_db->fetchAll($sql, array('project_id' => $project_id));
return $this->generateRowSet($resultSet);
// return $resultSet;
}
public function fetchClones($project_id)
{
$sql = "
SELECT
c.project_id as project_id
,c.project_id_parent as project_id_origin
,c.external_link
,c.member_id
,c.text
,' ' as catTitle
,(select project_category_id from project p where p.project_id = c.project_id_parent) project_category_id
,p.title
,p.image_small
,p.changed_at
FROM project_clone c
JOIN project p ON p.project_id = c.project_id
WHERE c.is_deleted = 0 and c.is_valid = 1 and c.project_id_parent = :project_id
AND p.`status` = 100
order by c.created_at desc
";
$resultSet = $this->_db->fetchAll($sql, array('project_id' => $project_id));
return $this->generateRowSet($resultSet);
// return $resultSet;
}
public function fetchParent($project_id)
{
$sql = "
SELECT
*
FROM project_clone c
WHERE c.is_deleted = 0 and c.is_valid = 1 and c.project_id = :project_id
";
$resultSet = $this->_db->fetchRow($sql, array('project_id' => $project_id));
return $this->generateRowSet($resultSet);
}
public function fetchRelatedProducts($project_id)
{
$sql = "
select distinct * from
(
SELECT
c.project_id as project_id
,c.external_link
,c.member_id
,c.text
,' ' as catTitle
,(select project_category_id from project p where p.project_id = c.project_id_parent) project_category_id
,p.title
,p.image_small
,p.changed_at
FROM project_clone c
JOIN project p on p.project_id = c.project_id
WHERE c.is_deleted = 0 and c.is_valid = 1 and c.project_id_parent = :project_id
AND p.`status` = 100
union
SELECT
c.project_id as project_id
,c.external_link
,c.member_id
,c.text
,' ' as catTitle
,(select project_category_id from project p where p.project_id = c.project_id_parent) project_category_id
,p.title
,p.image_small
,p.changed_at
FROM project_clone c
JOIN project p on p.project_id = c.project_id
WHERE c.project_id<> :project_id and c.is_deleted = 0 and c.is_valid = 1 AND p.`status` = 100 and c.project_id_parent in (
select project_id_parent from project_clone c
where c.project_id = :project_id and c.is_valid = 1 and c.is_deleted = 0
)
) a
where a.catTitle is not null
order by changed_at desc
";
$resultSet = $this->_db->fetchAll($sql, array('project_id' => $project_id));
return $this->generateRowSet($resultSet);
}
public function fetchCredits()
{
$sql = "
SELECT
c.project_clone_id
,c.project_id
,c.project_id_parent
,c.external_link
,c.text
,c.member_id as reported_by
,m.username as reporter_username
,m.profile_image_url as reporter_profile_image_url
,p.cat_title catTitle
,p.title
,p.image_small
,p.changed_at
,p.laplace_score
,p.member_id
,p.username
,pp.cat_title parent_catTitle
,pp.title parent_title
,pp.image_small parent_image_small
,pp.changed_at parent_changed_at
,pp.laplace_score parent_laplace_score
,pp.member_id parent_member_id
,pp.username parent_username
FROM project_clone c
join stat_projects pp on pp.project_id =c.project_id_parent
join member m on m.member_id = c.member_id
left JOIN stat_projects p on p.project_id = c.project_id
WHERE c.is_deleted = 0 and c.is_valid = 0 AND pp.status = 100
order by c.created_at desc
";
$resultSet = $this->_db->fetchAll($sql);
return $this->generateRowSet($resultSet);
}
+ /**
+ * @return string comma seperated ids
+ */
+ function fetchChildrensIds($project_id){
+ $sql = "
+ select GROUP_CONCAT(project_id) as ids from project_clone c where c.project_id_parent = :project_id
+ ";
+ $resultSet = $this->_db->fetchRow($sql, array('project_id' => $project_id));
+ return $resultSet['ids'];
+ }
+
+ /**
+ * @return string comma seperated ids
+ */
+ function fetchParentIds($project_id){
+ $sql = "
+ select GROUP_CONCAT(project_id_parent) as ids from project_clone c where c.project_id = :project_id
+ ";
+ $resultSet = $this->_db->fetchRow($sql, array('project_id' => $project_id));
+ return $resultSet['ids'];
+ }
+
+ /**
+ * @return string siblings project ids without itself
+ */
+ function fetchSiblings($project_id){
+ $sql = "
+ select GROUP_CONCAT(distinct project_id) as ids from project_clone c where c.project_id_parent in (
+ select project_id_parent from project_clone c where c.project_id = :project_id
+ ) and c.project_id <> :project_id
+ ";
+ $resultSet = $this->_db->fetchRow($sql, array('project_id' => $project_id));
+ return $resultSet['ids'];
+ }
+
+ /**
+ * @return string comma seperated ids
+ */
+ function fetchAncestersIds($project_id,$level=3){
+
+ $parentIds = self::fetchParentIds($project_id);
+ $ids='';
+ while ($level>0 && strlen($parentIds)>0) {
+ $sql = "select GROUP_CONCAT(distinct project_id_parent) as ids from project_clone c where c.project_id in(".$parentIds.")";
+ $resultSet = $this->_db->fetchRow($sql);
+ if($resultSet['ids'])
+ {
+ $ids.=','.$resultSet['ids'];
+ }
+ else{
+ break;
+ }
+ $parentIds = $resultSet['ids'];
+ $level--;
+ }
+ if(substr($ids, 0, 1)==','){ $ids=substr($ids,1);};
+ return $ids;
+ }
}
\ No newline at end of file
diff --git a/application/modules/default/views/helpers/Image.php b/application/modules/default/views/helpers/Image.php
index 5c4b44966..752c3a67a 100644
--- a/application/modules/default/views/helpers/Image.php
+++ b/application/modules/default/views/helpers/Image.php
@@ -1,169 +1,190 @@
.
**/
class Default_View_Helper_Image extends Zend_View_Helper_Abstract
{
protected $_operations = array(
'crop' => '%d',
'width' => '%d',
'height' => '%d',
'quality' => '%d',
'bgColor' => '%s',
'progressive' => '%d'
);
protected $_options = array(
'temporal' => false
);
protected $_separator = '-';
/**
* @param $filename
* @param array $options
* @return string|null
*/
public function Image($filename, $options = array())
{
if (false === $this->validUri($filename)) {
return $this->createImageUri($filename, $options);
}
$uri = $filename;
if (false === $this->isLocalhost($filename)) {
$httpScheme = 'https';
$uri = $this->replaceScheme($filename, $httpScheme);
}
if (empty($options)) {
return $uri;
}
return $this->updateImageUri($uri, $options);
}
/**
* @param $filename
* @return bool
*/
private function validUri($filename)
{
return Zend_Uri::check($filename);
}
/**
* @param $filename
* @param $options
* @return string
*/
private function createImageUri($filename, $options)
{
$operations = "";
if (isset($options['width']) && isset($options['height'])) {
$operations .= $options['width'] . 'x' . $options['height'];
} else {
//$operations .= '80x80';
$operations .= '';
}
if (isset($options['crop'])) {
$operations .= '-' . $options['crop'];
} else {
//$operations .= '-2';
$operations .= '';
}
if ($filename == "") {
$filename = 'default.png';
}
if (isset($options['temporal'])) {
$filename = '/img/default/tmp/' . $filename;
$url = $filename;
} else {
if (strpos($filename, '.gif') > 0 || $operations == '') {
$url = IMAGES_MEDIA_SERVER . '/img/' . $filename;
} else {
$url = IMAGES_MEDIA_SERVER . '/cache/' . $operations . '/img/' . $filename;
}
}
return $url;
}
/**
* @param $filename
* @param $getScheme
* @return string|string[]|null
*/
private function replaceScheme($filename, $getScheme)
{
$result = preg_replace("|^https?|", $getScheme, $filename);
return $result;
}
/**
* @param $filename
* @param $options
* @return string|string[]|null
*/
private function updateImageUri($filename, $options)
{
$dimension = '';
if (isset($options['width']) && isset($options['height'])) {
$dimension = $options['width'] . 'x' . $options['height'];
} else {
if (isset($options['width']) && (false === isset($options['height']))) {
$dimension = $options['width'] . 'x' . $options['width'];
} else {
if (isset($options['height']) && (false === isset($options['width']))) {
$dimension = $options['height'] . 'x' . $options['height'];
}
}
}
$uri = preg_replace("/\d\d\dx\d\d\d/", $dimension, $filename);
return $uri;
}
/**
* @param string $filename
* @return bool
*/
private function isLocalhost($filename)
{
$host = parse_url($filename, PHP_URL_HOST);
$whitelist = array('127.0.0.1', '::1', 'localhost');
if (in_array($host, $whitelist)) {
return true;
}
return false;
}
+ public function getDataURI($image, $mime = '') {
+ return 'data: '.(function_exists('mime_content_type') ? mime_content_type($image) : $mime).';base64,'.base64_encode(file_get_contents($image));
+ }
+
+ public function getImageDataFromUrl($filename, $options)
+ {
+ $url = $this->Image($filename, $options);
+ $urlParts = pathinfo($url);
+ $extension = $urlParts['extension'];
+ $ch = curl_init();
+ curl_setopt($ch, CURLOPT_URL, $url);
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+ curl_setopt($ch, CURLOPT_HEADER, 0);
+ $response = curl_exec($ch);
+ curl_close($ch);
+ $base64 = 'data:image/' . $extension . ';base64,' . base64_encode($response);
+
+ return $base64;
+ }
+
}
\ No newline at end of file
diff --git a/application/modules/default/views/scripts/explore/index-react8.phtml b/application/modules/default/views/scripts/explore/index-react8.phtml
new file mode 100755
index 000000000..bf858ded5
--- /dev/null
+++ b/application/modules/default/views/scripts/explore/index-react8.phtml
@@ -0,0 +1,253 @@
+.
+ **/
+$modelCategory = new Default_Model_DbTable_ProjectCategory();
+$this->dataCategory = $modelCategory->findSingleRow($this->cat_id);
+$store_config = Zend_Registry::get('store_config');
+$host = $store_config->host;
+$og_server = $this->serverUrl(true);
+$catTitle = '';
+if($this->dataCategory['project_category_id'])
+{
+ $catTitle = $this->dataCategory['title'];
+}
+if($this->filters['order'] == 'latest'){
+ $og_title = 'Browse '.$catTitle.' Latest | '.$host;
+}else if($this->filters['order'] == 'top'){
+ $og_title = 'Browse '.$catTitle.' Top | '.$host;
+}else{
+ $og_title='Browse '.$catTitle.' | '.$host;
+}
+$og_description = $og_title .'| A community for free and open source software and libre content';
+$this->templateConfigData = Zend_Registry::get('store_template');
+$og_image = 'https://' . $_SERVER['HTTP_HOST'] .$this->templateConfigData['logo'];
+$this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA);
+$this->headMeta()->appendProperty('og:type', 'website');
+$this->headMeta()->appendProperty('og:url', $og_server);
+$this->headMeta()->appendProperty('og:title', $og_title);
+$this->headMeta()->appendProperty('og:site_name',$host);
+$this->headMeta()->appendProperty('og:description',$og_description);
+$this->headMeta()->appendProperty('og:image',$og_image);
+
+
+$helperBuildExploreUrl = new Default_View_Helper_BuildExploreUrl();
+$modelInfo = new Default_Model_Info();
+
+$this->countSupporters = $modelInfo->getCountAllSupporters();
+$this->supporters = $modelInfo->getNewActiveSupporters(7);
+$this->headLink()->appendStylesheet('/theme/flatui/css/explore_index.css');
+
+
+if($this->inputFilterOriginal ==1)
+{
+ $checkedOriginal = ' checked';
+}else
+{
+ $checkedOriginal = '';
+}
+
+?>
+
+
+
+
+
+
+
+
+
+
+ comments = $modelInfo->getLatestComments(5, $this->cat_id, $this->tags);
+ //$donations = $modelInfo->getLatestPlings(5, $this->cat_id);
+ $topprods = $modelInfo->getMostDownloaded(100, $this->cat_id, $this->tags);
+ $asidehide = '';
+ if(!$this->catabout && count($this->comments)==0 && count($topprods)==0 )
+ {
+ $asidehide = 'hide';
+ }
+ $this->show_git = false;
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+inlineScript()->appendScript(
+ ' $(document).ready(function(){
+ TooltipUser.setup("tooltipuserleft","left");
+ TooltipUser.setup("tooltipuser","right");
+ FilterBrowseOriginalFn.setup();
+ FilterBrowseTagGroupFn.setup();
+ });
+ ');
diff --git a/application/modules/default/views/scripts/explore/index-react9.phtml b/application/modules/default/views/scripts/explore/index-react9.phtml
new file mode 100755
index 000000000..bf858ded5
--- /dev/null
+++ b/application/modules/default/views/scripts/explore/index-react9.phtml
@@ -0,0 +1,253 @@
+.
+ **/
+$modelCategory = new Default_Model_DbTable_ProjectCategory();
+$this->dataCategory = $modelCategory->findSingleRow($this->cat_id);
+$store_config = Zend_Registry::get('store_config');
+$host = $store_config->host;
+$og_server = $this->serverUrl(true);
+$catTitle = '';
+if($this->dataCategory['project_category_id'])
+{
+ $catTitle = $this->dataCategory['title'];
+}
+if($this->filters['order'] == 'latest'){
+ $og_title = 'Browse '.$catTitle.' Latest | '.$host;
+}else if($this->filters['order'] == 'top'){
+ $og_title = 'Browse '.$catTitle.' Top | '.$host;
+}else{
+ $og_title='Browse '.$catTitle.' | '.$host;
+}
+$og_description = $og_title .'| A community for free and open source software and libre content';
+$this->templateConfigData = Zend_Registry::get('store_template');
+$og_image = 'https://' . $_SERVER['HTTP_HOST'] .$this->templateConfigData['logo'];
+$this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA);
+$this->headMeta()->appendProperty('og:type', 'website');
+$this->headMeta()->appendProperty('og:url', $og_server);
+$this->headMeta()->appendProperty('og:title', $og_title);
+$this->headMeta()->appendProperty('og:site_name',$host);
+$this->headMeta()->appendProperty('og:description',$og_description);
+$this->headMeta()->appendProperty('og:image',$og_image);
+
+
+$helperBuildExploreUrl = new Default_View_Helper_BuildExploreUrl();
+$modelInfo = new Default_Model_Info();
+
+$this->countSupporters = $modelInfo->getCountAllSupporters();
+$this->supporters = $modelInfo->getNewActiveSupporters(7);
+$this->headLink()->appendStylesheet('/theme/flatui/css/explore_index.css');
+
+
+if($this->inputFilterOriginal ==1)
+{
+ $checkedOriginal = ' checked';
+}else
+{
+ $checkedOriginal = '';
+}
+
+?>
+
+
+
+
+
+
+
+
+
+
+ comments = $modelInfo->getLatestComments(5, $this->cat_id, $this->tags);
+ //$donations = $modelInfo->getLatestPlings(5, $this->cat_id);
+ $topprods = $modelInfo->getMostDownloaded(100, $this->cat_id, $this->tags);
+ $asidehide = '';
+ if(!$this->catabout && count($this->comments)==0 && count($topprods)==0 )
+ {
+ $asidehide = 'hide';
+ }
+ $this->show_git = false;
+ ?>
+
+
+
+
+
+
+
+
+
+
+
+
+inlineScript()->appendScript(
+ ' $(document).ready(function(){
+ TooltipUser.setup("tooltipuserleft","left");
+ TooltipUser.setup("tooltipuser","right");
+ FilterBrowseOriginalFn.setup();
+ FilterBrowseTagGroupFn.setup();
+ });
+ ');
diff --git a/application/modules/default/views/scripts/product/index.phtml b/application/modules/default/views/scripts/product/index.phtml
index 49ab3b29d..e3cd63e41 100644
--- a/application/modules/default/views/scripts/product/index.phtml
+++ b/application/modules/default/views/scripts/product/index.phtml
@@ -1,1221 +1,1225 @@
.
**/
$helpAddDefaultScheme = new Default_View_Helper_AddDefaultScheme();
$helpMemberUrl = new Default_View_Helper_BuildMemberUrl();
$helpEncryptUrl = new Default_View_Helper_EncryptUrl();
$helpImage = new Default_View_Helper_Image();
$helpTruncate = new Default_View_Helper_Truncate();
$helpProductUrl = new Default_View_Helper_BuildProductUrl();
$helpBBCode = new Default_View_Helper_Bbcode2html();
$helperUserRole = new Backend_View_Helper_UserRole();
$userRoleName = $helperUserRole->userRole();
$isAdmin = false;
if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) {
$isAdmin = true;
}
$identity = Zend_Auth::getInstance()->getStorage()->read();
$loginUrl = '/login?redirect=' . $helpEncryptUrl->encryptUrl(Zend_Controller_Front::getInstance()->getRequest()
->getRequestUri(), true);
$viewSidebar = 'product/partials/productAboutSidebar.phtml';
$viewClaimBox = false;
if ($this->product->claimable == 1) {
$viewClaimBox = 'product/partials/productClaimTopHeader.phtml';
}
$helpProjectFiles = new Default_View_Helper_ProjectFiles();
$productFileInfos = $helpProjectFiles->projectFiles($this->product->ppload_collection_id);
$this->product->title = Default_Model_HtmlPurify::purify($this->product->title);
$this->product->description = Default_Model_BBCode::renderHtml(Default_Model_HtmlPurify::purify($this->product->description));
$this->product->version = Default_Model_HtmlPurify::purify($this->product->version);
//$this->product->embed_code =Default_Model_HtmlPurify::purify($this->product->embed_code,Default_Model_HtmlPurify::ALLOW_EMBED);
$this->product->link_1 = Default_Model_HtmlPurify::purify($helpAddDefaultScheme->addDefaultScheme($this->product->link_1),Default_Model_HtmlPurify::ALLOW_URL);
$this->product->source_url = Default_Model_HtmlPurify::purify($this->product->source_url,Default_Model_HtmlPurify::ALLOW_URL);
$this->product->facebook_code = Default_Model_HtmlPurify::purify($this->product->facebook_code,Default_Model_HtmlPurify::ALLOW_URL);
$this->product->twitter_code = Default_Model_HtmlPurify::purify($this->product->twitter_code,Default_Model_HtmlPurify::ALLOW_URL);
$this->product->google_code = Default_Model_HtmlPurify::purify($this->product->google_code,Default_Model_HtmlPurify::ALLOW_URL);
$this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA);
$this->headMeta()->setName('description',
$helpTruncate->truncate($this->product->description, 200, '...', false, true));
$this->headMeta()->setName('title',
$helpTruncate->truncate($this->product->title, 200, '...', false, true));
$this->headMeta()->appendProperty('og:url', $helpProductUrl->buildProductUrl($this->product->project_id, '', null, true));
$this->headMeta()->appendProperty('og:type', 'website');
$this->headMeta()->appendProperty('og:title', $this->product->title);
$this->headMeta()->appendProperty('og:description',
$helpTruncate->truncate($this->product->description, 200, '...', false, true));
$this->headMeta()->appendProperty('og:image',
$helpImage->Image($this->product->image_small, array('width' => 400, 'height' => 400)));
$tableProject = new Default_Model_Project();
$tableCollection = new Default_Model_Collection();
$tableProjectUpdates = new Default_Model_ProjectUpdates();
$this->updates = $tableProjectUpdates->fetchProjectUpdates($this->product->project_id);
$tableProjectRatings = new Default_Model_DbTable_ProjectRating();
$this->ratings = $tableProjectRatings->fetchRating($this->product->project_id);
//$cntRatingsActive = 0;
// foreach ($this->ratings as $p) {
// if($p['rating_active']==1) $cntRatingsActive =$cntRatingsActive+1;
// }
if (Zend_Auth::getInstance()->hasIdentity()){
$this->ratingOfUser = $tableProjectRatings->getProjectRateForUser($this->product->project_id,$identity->member_id);
}
$tableProjectFollower = new Default_Model_DbTable_ProjectFollower();
$this->likes = $tableProjectFollower->fetchLikesForProject($this->product->project_id);
$projectplings = new Default_Model_ProjectPlings();
$this->projectplings = $projectplings->fetchPlingsForProject($this->product->project_id);
$projectsupport = new Default_Model_SectionSupport();
$this->projectaffiliates = $projectsupport->fetchAffiliatesForProject($this->product->project_id);
$tagmodel = new Default_Model_Tags();
$helperUserRole = new Backend_View_Helper_UserRole();
$userRoleName = $helperUserRole->userRole();
$this->userRoleName = $userRoleName;
$productJson = Zend_Json::encode(Default_Model_Collection::cleanProductInfoForJson($this->product->toArray()));
$filesJson = $this->filesJson;
$helperCatXdgType = new Default_View_Helper_CatXdgType();
$xdgTypeJson = Zend_Json::encode($helperCatXdgType->catXdgType($this->product->project_category_id));
$isowner = false;
if(Zend_Auth::getInstance()->hasIdentity() && $identity->member_id==$this->product->member_id){
$isowner = true;
}
$this->isowner = $isowner;
$filesTable = new Default_Model_DbTable_PploadFiles();
$countFiles = $filesTable->fetchFilesCntForProject($this->product->ppload_collection_id);
$pics= $tableProject->getGalleryPictureSources($this->product->project_id);
if(sizeof($pics)==0)
{
array_push($pics,$this->product->image_small);
}
$this->galleryPictures=array();
foreach ($pics as $p) {
$this->galleryPictures[] = $this->Image($p, array('height' => '600'));
}
$galleryPicturesJson = Zend_Json::encode($this->galleryPictures);
?>
hasIdentity()) {
?>
hasIdentity()) {
?>
hasIdentity()) { ?>
render('partials/sidebarRating.phtml'); ?>
render('partials/sidebarScore.phtml'); ?>
product->is_gitlab_project && $this->product->use_gitlab_project_readme && null != $this->gitlab_project['readme_url']) {
?>
Description:
=$this->readme ?>
Description:
=$this->product->description ?>
updates) > 0) {
$this->productUpdate = $this->updates[0];
?>
Last changelog:
= $this->render('product/partials/productUpdatesV1.phtml'); ?>
paramPageId;
$testComments = $modelComments->getCommentTreeForProject($this->product->project_id);
$testComments->setItemCountPerPage(25);
$testComments->setCurrentPageNumber($offset);
$this->comments = $testComments;
echo $this->render('product/partials/productCommentsUX1.phtml');
?>
partial(
$viewClaimBox,
array(
"member" => $this->member,
"product" => $this->product
)
);
}
?>
updates) > 0) { ?>
updates as $this->productUpdate) {
echo $this->render('product/partials/productUpdatesV1.phtml');
}
?>
product->show_gitlab_project_issues) {
?>
render('product/partials/productRating.phtml');
?>
render('product/partials/productRating2.phtml');
?>
+
+
+
+
likes) > 0) { ?>
render('product/partials/productLikes.phtml');
?>
projectplings) > 0) { ?>
render('product/partials/productPlings.phtml');
?>
render('product/partials/productAffiliates.phtml');
?>
render('product/partials/ppload.phtml');
?>
product->claimable)) { ?>
product->paypal_mail)
{
echo $this->partial(
'/product/partials/support_box.phtml',
array(
"authMember" => $identity,
"project_id" => $this->product->project_id,
"project_title" => $this->product->title,
"ppload_collection_id" => $this->product->ppload_collection_id,
"project_category_id" => $this->product->project_category_id,
"project_category_title" => $this->product->cat_title,
"isAdmin" => $isAdmin
)
);
}
?>
render('partials/sidebarRating.phtml'); */ ?>
*/
?>
countAllCollectionsForProject($this->product->project_id);
if($cntCollections>0) {
?>
moreProducts = $tableCollection->fetchAllCollectionsForProject($this->product->project_id, 6);
$this->moreProductsTitle = 'Is part of these Collections';
if (count($this->moreProducts) > 0) {
echo $this->render('product/partials/productMoreProductsWidgetV1.phtml');
} ?>
moreProducts = $tableProject->fetchMoreProjects($this->product, 6);
$this->moreProductsTitle = 'More ' . $this->product->cat_title . ' from ' . $this->product->username;
if (count($this->moreProducts) > 0) {
echo $this->render('product/partials/productMoreProductsWidgetV1.phtml');
} ?>
moreProducts = $tableProject->fetchMoreProjectsOfOtherUsr($this->product, 6);
$this->moreProductsTitle = 'Other ' . $this->product->cat_title;
if (count($this->moreProducts) > 0) {
echo $this->render('product/partials/productMoreProductsWidgetV1.phtml');
} ?>
render('partials/sidebarCcLicense.phtml'); ?>
isProjectEbook($this->product->project_id)) {
echo $this->render('product/partials/ebook_details.phtml');
}
?>
render('product/partials/details.phtml'); ?>
render('product/partials/tags.phtml'); ?>
inlineScript()->appendScript(
' $(document).ready(function(){
InitActiveHashTab.setup();
PartialJson.setup();
PartialJsonFraud.setup();
PartialJsonClone.setup();
ProductDetailCarousel.setup();
PartialCommentReviewForm.setup();
PartialCommentReviewFormNew.setup();
PartialsButtonHeartDetail.setup();
PartialsButtonPlingProject.setup();
TooltipUser.setup("tooltipuserleft","left");
AppimagequestionOnClick.setup();
Opendownloadfile.setup();
CreateScoreRatingPopup.setup();
$(\'.tooltipheart\').tooltipster({theme: [\'tooltipster-light\', \'tooltipster-light-customized\'],
contentCloning: true,
contentAsHTML: true,
interactive: true});
});
');
diff --git a/application/modules/default/views/scripts/product/partials/productRelated.phtml b/application/modules/default/views/scripts/product/partials/productRelated.phtml
new file mode 100644
index 000000000..15f316dfe
--- /dev/null
+++ b/application/modules/default/views/scripts/product/partials/productRelated.phtml
@@ -0,0 +1,50 @@
+
+
+related_ancesters){
+?>
+ Ancesters
+
+userProducts=$this->related_ancesters;
+echo $this->render('product/partials/productRelatedProducts.phtml'); ?>
+
+
+
+related_parents){
+?>
+ Parents
+
+userProducts=$this->related_parents;
+echo $this->render('product/partials/productRelatedProducts.phtml'); ?>
+
+
+
+related_siblings){
+?>
+ Siblings
+
+userProducts=$this->related_siblings;
+echo $this->render('product/partials/productRelatedProducts.phtml'); ?>
+
+
+
+
+related_children){
+?>
+ Children
+
+userProducts=$this->related_children;
+echo $this->render('product/partials/productRelatedProducts.phtml'); ?>
+
+
diff --git a/application/modules/default/views/scripts/product/partials/productRelatedProducts.phtml b/application/modules/default/views/scripts/product/partials/productRelatedProducts.phtml
new file mode 100644
index 000000000..e1b90df78
--- /dev/null
+++ b/application/modules/default/views/scripts/product/partials/productRelatedProducts.phtml
@@ -0,0 +1,68 @@
+
+
+userProducts == null || count($this->userProducts)==0) return;
+
+ foreach ($this->userProducts as $product):
+
+ ?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/application/modules/default/views/scripts/subscription/support2.phtml b/application/modules/default/views/scripts/subscription/support2.phtml
index d6da9d3e8..be93f0364 100644
--- a/application/modules/default/views/scripts/subscription/support2.phtml
+++ b/application/modules/default/views/scripts/subscription/support2.phtml
@@ -1,464 +1,464 @@
.
*
* Created: 31.05.2017
*/
$modelInfo= new Default_Model_Info();
$filter = new Local_Filter_Url_Encrypt();
$thisurl = "/";
if(isset($_GET['url'])) {
$thisurl = $_GET['url'];
}else
{
$thisurl= Zend_Controller_Front::getInstance()->getRequest()->getScheme() . '://' . Zend_Controller_Front::getInstance()->getRequest()->getHttpHost().$_SERVER["REQUEST_URI"];
}
$url_login = "/login/redirect/".$filter->filter($thisurl);
$sections = $this->sections;
$creator_id = $this->creator_id;
$baseurlStore = Zend_Registry::get('config')->settings->client->default->baseurl_store;
?>
Become a Supporter
-
Help sustain any of these sub-sections and creators providing content for it (see Pling FAQ ).
+
Support any of these sections and their creators via a donation:
\ No newline at end of file
diff --git a/httpdocs/theme/react/all.js b/httpdocs/theme/react/all.js
index 5aa96a6c1..4ad19565d 100644
--- a/httpdocs/theme/react/all.js
+++ b/httpdocs/theme/react/all.js
@@ -1,5054 +1,751 @@
-'use strict';
-
window.appHelpers = function () {
-
function getEnv(domain) {
- var env = void 0;
+ let env;
+
if (this.splitByLastDot(domain) === 'com' || this.splitByLastDot(domain) === 'org') {
env = 'live';
} else {
env = 'test';
}
+
return env;
}
function getDeviceWidth(width) {
- var device = void 0;
+ let device;
+
if (width > 1720) {
device = "very-huge";
} else if (width < 1720 && width > 1500) {
device = "huge";
} else if (width < 1500 && width > 1250) {
device = "full";
} else if (width < 1250 && width >= 1000) {
device = "large";
} else if (width < 1000 && width >= 661) {
device = "mid";
} else if (width < 661 && width >= 400) {
device = "tablet";
} else if (width < 400) {
device = "phone";
}
+
return device;
}
function splitByLastDot(text) {
var index = text.lastIndexOf('.');
return text.slice(index + 1);
}
function getTimeAgo(datetime) {
- var a = timeago().format(datetime);
+ const a = timeago().format(datetime);
return a;
}
function getFileSize(size) {
if (isNaN(size)) size = 0;
-
if (size < 1024) return size + ' Bytes';
-
size /= 1024;
-
if (size < 1024) return size.toFixed(2) + ' Kb';
-
size /= 1024;
-
if (size < 1024) return size.toFixed(2) + ' Mb';
-
size /= 1024;
-
if (size < 1024) return size.toFixed(2) + ' Gb';
-
size /= 1024;
-
return size.toFixed(2) + ' Tb';
}
function generateFilterUrl(location, currentCat) {
- var link = {};
+ let link = {};
+
if (currentCat && currentCat !== 0) {
link.base = "/browse/cat/" + currentCat + "/ord/";
} else {
link.base = "/browse/ord/";
}
+
if (location.search) link.search = location.search;
return link;
}
function generateFileDownloadHash(file, env) {
- var salt = void 0;
+ let salt;
+
if (env === "test") {
salt = "vBHnf7bbdhz120bhNsd530LsA2mkMvh6sDsCm4jKlm23D186Fj";
} else {
salt = "Kcn6cv7&dmvkS40Hna§4ffcvl=021nfMs2sdlPs123MChf4s0K";
}
- var timestamp = Math.floor(new Date().getTime() / 1000 + 3600);
- var hash = md5(salt + file.collection_id + timestamp);
+
+ const timestamp = Math.floor(new Date().getTime() / 1000 + 3600);
+ const hash = md5(salt + file.collection_id + timestamp);
return hash;
}
return {
- getEnv: getEnv,
- getDeviceWidth: getDeviceWidth,
- splitByLastDot: splitByLastDot,
- getTimeAgo: getTimeAgo,
- getFileSize: getFileSize,
- generateFilterUrl: generateFilterUrl,
- generateFileDownloadHash: generateFileDownloadHash
+ getEnv,
+ getDeviceWidth,
+ splitByLastDot,
+ getTimeAgo,
+ getFileSize,
+ generateFilterUrl,
+ generateFileDownloadHash
};
}();
-"use strict";
-
window.categoryHelpers = function () {
-
function findCurrentCategories(categories, catId) {
- var currentCategories = {};
+ let currentCategories = {};
categories.forEach(function (mc, index) {
if (parseInt(mc.id) === catId) {
currentCategories.category = mc;
} else {
- var cArray = categoryHelpers.convertCatChildrenObjectToArray(mc.children);
+ const cArray = categoryHelpers.convertCatChildrenObjectToArray(mc.children);
cArray.forEach(function (sc, index) {
if (parseInt(sc.id) === catId) {
currentCategories.category = mc;
currentCategories.subcategory = sc;
} else {
- var scArray = categoryHelpers.convertCatChildrenObjectToArray(sc.children);
+ const scArray = categoryHelpers.convertCatChildrenObjectToArray(sc.children);
scArray.forEach(function (ssc, index) {
if (parseInt(ssc.id) === catId) {
currentCategories.category = mc;
currentCategories.subcategory = sc;
currentCategories.secondSubCategory = ssc;
}
});
}
});
}
});
return currentCategories;
}
function convertCatChildrenObjectToArray(children) {
- var cArray = [];
+ let cArray = [];
+
for (var i in children) {
cArray.push(children[i]);
}
+
return cArray;
}
return {
- findCurrentCategories: findCurrentCategories,
- convertCatChildrenObjectToArray: convertCatChildrenObjectToArray
+ findCurrentCategories,
+ convertCatChildrenObjectToArray
};
}();
-"use strict";
-
window.productHelpers = function () {
-
function getNumberOfProducts(device, numRows) {
- var num = void 0;
+ let num;
+
if (device === "very-huge") {
num = 7;
} else if (device === "huge") {
num = 6;
} else if (device === "full") {
num = 5;
} else if (device === "large") {
num = 4;
} else if (device === "mid") {
num = 3;
} else if (device === "tablet") {
num = 2;
} else if (device === "phone") {
num = 1;
}
+
if (numRows) num = num * numRows;
return num;
}
function generatePaginationObject(numPages, pathname, currentCategoy, order, page) {
- var pagination = [];
+ let pagination = [];
+ let baseHref = "/browse";
- var baseHref = "/browse";
if (pathname.indexOf('cat') > -1) {
baseHref += "/cat/" + currentCategoy;
}
if (page > 1) {
- var prev = {
+ const prev = {
number: 'previous',
link: baseHref + "/page/" + parseInt(page - 1) + "/ord/" + order
};
pagination.push(prev);
}
for (var i = 0; i < numPages; i++) {
- var p = {
+ const p = {
number: parseInt(i + 1),
link: baseHref + "/page/" + parseInt(i + 1) + "/ord/" + order
};
pagination.push(p);
}
if (page < numPages) {
- var next = {
+ const next = {
number: 'next',
link: baseHref + "/page/" + parseInt(page + 1) + "/ord/" + order
};
pagination.push(next);
}
return pagination;
}
function calculateProductRatings(ratings) {
- var pRating = void 0;
- var totalUp = 0,
+ let pRating;
+ let totalUp = 0,
totalDown = 0;
ratings.forEach(function (r, index) {
if (r.rating_active === "1") {
if (r.user_like === "1") {
totalUp += 1;
} else if (r.user_dislike === "1") {
totalDown += 1;
}
}
});
pRating = 100 / ratings.length * (totalUp - totalDown);
return pRating;
}
function getActiveRatingsNumber(ratings) {
- var activeRatingsNumber = 0;
+ let activeRatingsNumber = 0;
ratings.forEach(function (r, index) {
if (r.rating_active === "1") {
activeRatingsNumber += 1;
}
});
return activeRatingsNumber;
}
function getFilesSummary(files) {
- var summery = {
+ let summery = {
downloads: 0,
archived: 0,
fileSize: 0,
total: 0
};
files.forEach(function (file, index) {
summery.total += 1;
summery.fileSize += parseInt(file.size);
summery.downloads += parseInt(file.downloaded_count);
});
-
return summery;
}
function checkIfLikedByUser(user, likes) {
- var likedByUser = false;
+ let likedByUser = false;
likes.forEach(function (like, index) {
if (user.member_id === like.member_id) {
likedByUser = true;
}
});
return likedByUser;
}
function getLoggedUserRatingOnProduct(user, ratings) {
- var userRating = -1;
+ let userRating = -1;
ratings.forEach(function (r, index) {
if (r.member_id === user.member_id) {
if (r.user_like === "1") {
userRating = 1;
} else {
userRating = 0;
}
}
});
return userRating;
}
function calculateProductLaplaceScore(ratings) {
- var laplace_score = 0;
- var upvotes = 0;
- var downvotes = 0;
+ let laplace_score = 0;
+ let upvotes = 0;
+ let downvotes = 0;
ratings.forEach(function (rating, index) {
if (rating.rating_active === "1") {
if (rating.user_like === "1") {
upvotes += 1;
} else if (rating.user_like === "0") {
downvotes += 1;
}
}
});
laplace_score = Math.round((upvotes + 6) / (upvotes + downvotes + 12), 2) * 100;
return laplace_score;
}
return {
- getNumberOfProducts: getNumberOfProducts,
- generatePaginationObject: generatePaginationObject,
- calculateProductRatings: calculateProductRatings,
- getActiveRatingsNumber: getActiveRatingsNumber,
- getFilesSummary: getFilesSummary,
- checkIfLikedByUser: checkIfLikedByUser,
- getLoggedUserRatingOnProduct: getLoggedUserRatingOnProduct,
- calculateProductLaplaceScore: calculateProductLaplaceScore
+ getNumberOfProducts,
+ generatePaginationObject,
+ calculateProductRatings,
+ getActiveRatingsNumber,
+ getFilesSummary,
+ checkIfLikedByUser,
+ getLoggedUserRatingOnProduct,
+ calculateProductLaplaceScore
};
}();
-"use strict";
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var ProductGroupScrollWrapper = function (_React$Component) {
- _inherits(ProductGroupScrollWrapper, _React$Component);
-
- function ProductGroupScrollWrapper(props) {
- _classCallCheck(this, ProductGroupScrollWrapper);
-
- var _this = _possibleConstructorReturn(this, (ProductGroupScrollWrapper.__proto__ || Object.getPrototypeOf(ProductGroupScrollWrapper)).call(this, props));
-
- _this.state = {
- products: [],
- offset: 0
- };
- _this.onProductGroupScroll = _this.onProductGroupScroll.bind(_this);
- _this.loadMoreProducts = _this.loadMoreProducts.bind(_this);
- return _this;
- }
-
- _createClass(ProductGroupScrollWrapper, [{
- key: "componentWillMount",
- value: function componentWillMount() {
- window.addEventListener("scroll", this.onProductGroupScroll);
- }
- }, {
- key: "componentDidMount",
- value: function componentDidMount() {
- this.loadMoreProducts();
- }
- }, {
- key: "onProductGroupScroll",
- value: function onProductGroupScroll() {
- var end = $("footer").offset().top;
- var viewEnd = $(window).scrollTop() + $(window).height();
- var distance = end - viewEnd;
- if (distance < 0 && this.state.loadingMoreProducts !== true) {
- this.setState({ loadingMoreProducts: true }, function () {
- this.loadMoreProducts();
- });
- }
- }
- }, {
- key: "loadMoreProducts",
- value: function loadMoreProducts() {
- var itemsPerScroll = 50;
- var moreProducts = store.getState().products.slice(this.state.offset, this.state.offset + itemsPerScroll);
- var products = this.state.products.concat(moreProducts);
- var offset = this.state.offset + itemsPerScroll;
- this.setState({
- products: products,
- offset: offset,
- loadingMoreProducts: false
- });
- }
- }, {
- key: "render",
- value: function render() {
- var loadingMoreProductsDisplay = void 0;
- if (this.state.loadingMoreProducts) {
- loadingMoreProductsDisplay = React.createElement(
- "div",
- { className: "product-group-scroll-loading-container" },
- React.createElement(
- "div",
- { className: "icon-wrapper" },
- React.createElement("span", { className: "glyphicon glyphicon-refresh spinning" })
- )
- );
- }
- return React.createElement(
- "div",
- { className: "product-group-scroll-wrapper" },
- React.createElement(ProductGroup, {
- products: this.state.products,
- device: this.props.device
- }),
- loadingMoreProductsDisplay
- );
- }
- }]);
-
- return ProductGroupScrollWrapper;
-}(React.Component);
-
-var ProductGroup = function (_React$Component2) {
- _inherits(ProductGroup, _React$Component2);
-
- function ProductGroup() {
- _classCallCheck(this, ProductGroup);
-
- return _possibleConstructorReturn(this, (ProductGroup.__proto__ || Object.getPrototypeOf(ProductGroup)).apply(this, arguments));
- }
-
- _createClass(ProductGroup, [{
- key: "render",
- value: function render() {
- var products = void 0;
- if (this.props.products) {
- var productsArray = this.props.products;
- if (this.props.numRows) {
- var limit = productHelpers.getNumberOfProducts(this.props.device, this.props.numRows);
- productsArray = productsArray.slice(0, limit);
- }
- products = productsArray.map(function (product, index) {
- return React.createElement(ProductGroupItem, {
- key: index,
- product: product
- });
- });
- }
-
- var sectionHeader = void 0;
- if (this.props.title) {
- sectionHeader = React.createElement(
- "div",
- { className: "section-header" },
- React.createElement(
- "h3",
- { className: "mdl-color-text--primary" },
- this.props.title
- ),
- React.createElement(
- "div",
- { className: "actions" },
- React.createElement(
- "a",
- { href: this.props.link, className: "mdl-button mdl-js-button mdl-button--colored mdl-button--raised mdl-js-ripple-effect mdl-color--primary" },
- "see more"
- )
- )
- );
- }
- return React.createElement(
- "div",
- { className: "products-showcase" },
- sectionHeader,
- React.createElement(
- "div",
- { className: "products-container row" },
- products
- )
- );
- }
- }]);
-
- return ProductGroup;
-}(React.Component);
-
-var ProductGroupItem = function (_React$Component3) {
- _inherits(ProductGroupItem, _React$Component3);
-
- function ProductGroupItem() {
- _classCallCheck(this, ProductGroupItem);
-
- return _possibleConstructorReturn(this, (ProductGroupItem.__proto__ || Object.getPrototypeOf(ProductGroupItem)).apply(this, arguments));
- }
-
- _createClass(ProductGroupItem, [{
- key: "render",
- value: function render() {
- var imageBaseUrl = void 0;
- if (store.getState().env === 'live') {
- imageBaseUrl = 'cn.opendesktop.org';
- } else {
- imageBaseUrl = 'cn.pling.it';
- }
- return React.createElement(
- "div",
- { className: "product square" },
- React.createElement(
- "div",
- { className: "content" },
- React.createElement(
- "div",
- { className: "product-wrapper mdl-shadow--2dp" },
- React.createElement(
- "a",
- { href: "/p/" + this.props.product.project_id },
- React.createElement(
- "div",
- { className: "product-image-container" },
- React.createElement(
- "figure",
- null,
- React.createElement("img", { className: "very-rounded-corners", src: 'https://' + imageBaseUrl + '/cache/200x171/img/' + this.props.product.image_small }),
- React.createElement(
- "span",
- { className: "product-info-title" },
- this.props.product.title
- )
- )
- ),
- React.createElement(
- "div",
- { className: "product-info" },
- React.createElement(
- "span",
- { className: "product-info-description" },
- this.props.product.description
- )
- )
- )
- )
- )
- );
- }
- }]);
-
- return ProductGroupItem;
-}(React.Component);
-'use strict';
-
-var reducer = Redux.combineReducers({
+const reducer = Redux.combineReducers({
products: productsReducer,
product: productReducer,
lightboxGallery: lightboxGalleryReducer,
pagination: paginationReducer,
topProducts: topProductsReducer,
categories: categoriesReducer,
comments: commentsReducer,
users: usersReducer,
user: userReducer,
supporters: supportersReducer,
domain: domainReducer,
env: envReducer,
device: deviceReducer,
view: viewReducer,
filters: filtersReducer
});
-
/* reducers */
-function productsReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function productsReducer(state = {}, action) {
if (action.type === 'SET_PRODUCTS') {
return action.products;
} else {
return state;
}
}
-function productReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function productReducer(state = {}, action) {
if (action.type === 'SET_PRODUCT') {
return action.product;
} else if (action.type === 'SET_PRODUCT_FILES') {
- var s = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_files: action.files
});
return s;
} else if (action.type === 'SET_PRODUCT_UPDATES') {
- var _s = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_updates: action.updates
});
- return _s;
+ return s;
} else if (action.type === 'SET_PRODUCT_RATINGS') {
- var _s2 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_ratings: action.ratings
});
- return _s2;
+ return s;
} else if (action.type === 'SET_PRODUCT_LIKES') {
- var _s3 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_likes: action.likes
});
- return _s3;
+ return s;
} else if (action.type === 'SET_PRODUCT_PLINGS') {
- var _s4 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_plings: action.plings
});
- return _s4;
+ return s;
} else if (action.type === 'SET_PRODUCT_USER_RATINGS') {
- var _s5 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_userRatings: action.userRatings
});
- return _s5;
+ return s;
} else if (action.type === 'SET_PRODUCT_GALLERY') {
- var _s6 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_gallery: action.gallery
});
- return _s6;
+ return s;
} else if (action.type === 'SET_PRODUCT_COMMENTS') {
- var _s7 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_comments: action.comments
});
- return _s7;
+ return s;
} else if (action.type === 'SET_PRODUCT_ORIGINS') {
- var _s8 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_origins: action.origins
});
- return _s8;
+ return s;
} else if (action.type === 'SET_PRODUCT_RELATED') {
- var _s9 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_related: action.related
});
- return _s9;
+ return s;
} else if (action.type === 'SET_PRODUCT_MORE_PRODUCTS') {
- var _s10 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_more_products: action.products
});
- return _s10;
+ return s;
} else if (action.type === 'SET_PRODUCT_MORE_PRODUCTS_OTHER_USERS') {
- var _s11 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_more_products_other_users: action.products
});
- return _s11;
+ return s;
} else if (action.type === 'SET_PRODUCT_TAGS') {
- var _s12 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
r_tags_user: action.userTags,
r_tags_system: action.systemTags
});
- return _s12;
+ return s;
} else {
return state;
}
}
-function lightboxGalleryReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function lightboxGalleryReducer(state = {}, action) {
if (action.type === 'SHOW_LIGHTBOX') {
- var s = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
show: true,
currentItem: action.item
});
return s;
} else if (action.type === 'HIDE_LIGHTBOX') {
- var _s13 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
show: false
});
- return _s13;
+ return s;
} else {
return state;
}
}
-function paginationReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function paginationReducer(state = {}, action) {
if (action.type === 'SET_PAGINATION') {
return action.pagination;
} else {
return state;
}
}
-function topProductsReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function topProductsReducer(state = {}, action) {
if (action.type === 'SET_TOP_PRODUCTS') {
return action.products;
} else {
return state;
}
}
-function categoriesReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function categoriesReducer(state = {}, action) {
if (action.type === 'SET_CATEGORIES') {
- var s = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
items: categories
});
return s;
} else if (action.type === 'SET_CURRENT_CAT') {
- var _s14 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
current: action.cat
});
- return _s14;
+ return s;
} else if (action.type === 'SET_CURRENT_SUBCAT') {
- var _s15 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
currentSub: action.cat
});
- return _s15;
+ return s;
} else if (action.type === 'SET_CURRENT_SECONDSUBCAT') {
- var _s16 = Object.assign({}, state, {
+ const s = Object.assign({}, state, {
currentSecondSub: action.cat
});
- return _s16;
+ return s;
} else {
return state;
}
}
-function commentsReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function commentsReducer(state = {}, action) {
if (action.type === 'SET_COMMENTS') {
return action.comments;
} else {
return state;
}
}
-function usersReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function usersReducer(state = {}, action) {
if (action.type === 'SET_USERS') {
return action.users;
} else {
return state;
}
}
-function userReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function userReducer(state = {}, action) {
if (action.type === 'SET_USER') {
return action.user;
} else {
return state;
}
}
-function supportersReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function supportersReducer(state = {}, action) {
if (action.type === 'SET_SUPPORTERS') {
return action.supporters;
} else {
return state;
}
}
-function domainReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function domainReducer(state = {}, action) {
if (action.type === 'SET_DOMAIN') {
return action.domain;
} else {
return state;
}
}
-function envReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function envReducer(state = {}, action) {
if (action.type === 'SET_ENV') {
return action.env;
} else {
return state;
}
}
-function deviceReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function deviceReducer(state = {}, action) {
if (action.type === 'SET_DEVICE') {
return action.device;
} else {
return state;
}
}
-function viewReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function viewReducer(state = {}, action) {
if (action.type === 'SET_VIEW') {
return action.view;
} else {
return state;
}
}
-function filtersReducer() {
- var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- var action = arguments[1];
-
+function filtersReducer(state = {}, action) {
if (action.type === 'SET_FILTERS') {
return action.filters;
} else {
return state;
}
}
-
/* /reducers */
/* dispatch */
+
function setProducts(products) {
return {
type: 'SET_PRODUCTS',
products: products
};
}
function setProduct(product) {
return {
type: 'SET_PRODUCT',
product: product
};
}
function setProductFiles(files) {
return {
type: 'SET_PRODUCT_FILES',
files: files
};
}
function setProductUpdates(updates) {
return {
type: 'SET_PRODUCT_UPDATES',
updates: updates
};
}
function setProductRatings(ratings) {
return {
type: 'SET_PRODUCT_RATINGS',
ratings: ratings
};
}
function setProductLikes(likes) {
return {
type: 'SET_PRODUCT_LIKES',
likes: likes
};
}
function setProductPlings(plings) {
return {
type: 'SET_PRODUCT_PLINGS',
plings: plings
};
}
function setProductUserRatings(userRatings) {
return {
type: 'SET_PRODUCT_USER_RATINGS',
userRatings: userRatings
};
}
function setProductGallery(gallery) {
return {
type: 'SET_PRODUCT_GALLERY',
gallery: gallery
};
}
function setProductComments(comments) {
return {
type: 'SET_PRODUCT_COMMENTS',
comments: comments
};
}
function setProductOrigins(origins) {
return {
type: 'SET_PRODUCT_ORIGINS',
origins: origins
};
}
function setProductRelated(related) {
return {
type: 'SET_PRODUCT_RELATED',
related: related
};
}
function setProductMoreProducts(products) {
return {
type: 'SET_PRODUCT_MORE_PRODUCTS',
products: products
};
}
function setProductMoreProductsOtherUsers(products) {
return {
type: 'SET_PRODUCT_MORE_PRODUCTS_OTHER_USERS',
products: products
};
}
function setProductTags(userTags, systemTags) {
return {
type: 'SET_PRODUCT_TAGS',
userTags: userTags,
systemTags: systemTags
};
}
function showLightboxGallery(num) {
return {
type: 'SHOW_LIGHTBOX',
item: num
};
}
function hideLightboxGallery() {
return {
type: 'HIDE_LIGHTBOX'
};
}
function setPagination(pagination) {
return {
type: 'SET_PAGINATION',
pagination: pagination
};
}
function setTopProducts(topProducts) {
return {
type: 'SET_TOP_PRODUCTS',
products: topProducts
};
}
function setCategories(categories) {
return {
type: 'SET_CATEGORIES',
categories: categories
};
}
function setCurrentCategory(cat) {
return {
type: 'SET_CURRENT_CAT',
cat: cat
};
}
function setCurrentSubCategory(cat) {
return {
type: 'SET_CURRENT_SUBCAT',
cat: cat
};
}
function setCurrentSecondSubCategory(cat) {
return {
type: 'SET_CURRENT_SECONDSUBCAT',
cat: cat
};
}
function setComments(comments) {
return {
type: 'SET_COMMENTS',
comments: comments
};
}
function setUsers(users) {
return {
type: 'SET_USERS',
users: users
};
}
function setUser(user) {
return {
type: 'SET_USER',
user: user
};
}
function setSupporters(supporters) {
return {
type: 'SET_SUPPORTERS',
supporters: supporters
};
}
function setDomain(domain) {
return {
type: 'SET_DOMAIN',
domain: domain
};
}
function setEnv(env) {
return {
type: 'SET_ENV',
env: env
};
}
function setDevice(device) {
return {
type: 'SET_DEVICE',
device: device
};
}
function setView(view) {
return {
type: 'SET_VIEW',
view: view
};
}
function setFilters(filters) {
return {
type: 'SET_FILTERS',
filters: filters
};
}
-
/* /dispatch */
-"use strict";
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var ExplorePage = function (_React$Component) {
- _inherits(ExplorePage, _React$Component);
-
- function ExplorePage(props) {
- _classCallCheck(this, ExplorePage);
-
- var _this = _possibleConstructorReturn(this, (ExplorePage.__proto__ || Object.getPrototypeOf(ExplorePage)).call(this, props));
-
- _this.state = {
- device: store.getState().device,
- minHeight: 'auto'
- };
-
- _this.updateContainerHeight = _this.updateContainerHeight.bind(_this);
- return _this;
- }
-
- _createClass(ExplorePage, [{
- key: "componentWillReceiveProps",
- value: function componentWillReceiveProps(nextProps) {
- if (nextProps.device) {
- this.setState({ device: nextProps.device });
- }
- if (nextProps.products) {
- this.setState({ products: nextProps.products });
- }
- if (nextProps.filters) {
- this.setState({ filters: filters });
- }
- }
- }, {
- key: "updateContainerHeight",
- value: function updateContainerHeight(sideBarHeight) {
- this.setState({ minHeight: sideBarHeight + 100 });
- }
- }, {
- key: "render",
- value: function render() {
-
- var titleDisplay = void 0;
- if (this.props.categories) {
- var title = "";
- if (this.props.categories.currentSecondSub) {
- title = this.props.categories.currentSecondSub.title;
- } else {
- if (this.props.categories.currentSub) {
- title = this.props.categories.currentSub.title;
- } else {
- if (this.props.categories.current) {
- title = this.props.categories.current.title;
- }
- }
- }
-
- if (title.length > 0) {
- titleDisplay = React.createElement(
- "div",
- { className: "explore-page-category-title" },
- React.createElement(
- "h2",
- null,
- title
- ),
- React.createElement(
- "small",
- null,
- store.getState().pagination.totalcount,
- " results"
- )
- );
- }
- }
-
- return React.createElement(
- "div",
- { id: "explore-page" },
- React.createElement(
- "div",
- { className: "wrapper" },
- React.createElement(
- "div",
- { className: "main-content-container", style: { "minHeight": this.state.minHeight } },
- React.createElement(
- "div",
- { className: "left-sidebar-container" },
- React.createElement(ExploreLeftSideBarWrapper, {
- updateContainerHeight: this.updateContainerHeight
- })
- ),
- React.createElement(
- "div",
- { className: "main-content" },
- titleDisplay,
- React.createElement(
- "div",
- { className: "top-bar" },
- React.createElement(ExploreTopBarWrapper, null)
- ),
- React.createElement(
- "div",
- { className: "explore-products-container" },
- React.createElement(ProductGroupScrollWrapper, {
- device: this.state.device
- }),
- React.createElement(PaginationWrapper, null)
- )
- )
- ),
- React.createElement(
- "div",
- { className: "right-sidebar-container" },
- React.createElement(ExploreRightSideBarWrapper, null)
- )
- )
- );
- }
- }]);
-
- return ExplorePage;
-}(React.Component);
-
-var mapStateToExploreProps = function mapStateToExploreProps(state) {
- var device = state.device;
- var products = state.products;
- var categories = state.categories;
- return {
- device: device,
- products: products,
- categories: categories
- };
-};
-
-var mapDispatchToExploreProps = function mapDispatchToExploreProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var ExplorePageWrapper = ReactRedux.connect(mapStateToExploreProps, mapDispatchToExploreProps)(ExplorePage);
-
-var ExploreTopBar = function (_React$Component2) {
- _inherits(ExploreTopBar, _React$Component2);
-
- function ExploreTopBar(props) {
- _classCallCheck(this, ExploreTopBar);
-
- var _this2 = _possibleConstructorReturn(this, (ExploreTopBar.__proto__ || Object.getPrototypeOf(ExploreTopBar)).call(this, props));
-
- _this2.state = {};
- return _this2;
- }
-
- _createClass(ExploreTopBar, [{
- key: "render",
- value: function render() {
- var categories = this.props.categories;
- var currentId = void 0;
- if (categories.current) {
- currentId = categories.current.id;
- }
- if (categories.currentSub) {
- currentId = categories.currentSub.id;
- }
- if (categories.currentSecondSub) {
- currentId = categories.currentSecondSub.id;
- }
-
- var link = appHelpers.generateFilterUrl(window.location, currentId);
- var linkSearch = "";
- if (link.search) {
- linkSearch = link.search;
- }
-
- return React.createElement(
- "div",
- { className: "explore-top-bar" },
- React.createElement(
- "a",
- { href: link.base + "latest" + linkSearch, className: this.props.filters.order === "latest" ? "item active" : "item" },
- "Latest"
- ),
- React.createElement(
- "a",
- { href: link.base + "top" + linkSearch, className: this.props.filters.order === "top" ? "item active" : "item" },
- "Top"
- )
- );
- }
- }]);
-
- return ExploreTopBar;
-}(React.Component);
-
-var mapStateToExploreTopBarProps = function mapStateToExploreTopBarProps(state) {
- var filters = state.filters;
- var categories = state.categories;
- return {
- filters: filters,
- categories: categories
- };
-};
-
-var mapDispatchToExploreTopBarProps = function mapDispatchToExploreTopBarProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var ExploreTopBarWrapper = ReactRedux.connect(mapStateToExploreTopBarProps, mapDispatchToExploreTopBarProps)(ExploreTopBar);
-
-var ExploreLeftSideBar = function (_React$Component3) {
- _inherits(ExploreLeftSideBar, _React$Component3);
-
- function ExploreLeftSideBar(props) {
- _classCallCheck(this, ExploreLeftSideBar);
-
- var _this3 = _possibleConstructorReturn(this, (ExploreLeftSideBar.__proto__ || Object.getPrototypeOf(ExploreLeftSideBar)).call(this, props));
-
- _this3.state = {};
- return _this3;
- }
-
- _createClass(ExploreLeftSideBar, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- var sideBarHeight = $('#left-sidebar').height();
- this.props.updateContainerHeight(sideBarHeight);
- }
- }, {
- key: "render",
- value: function render() {
- var categoryTree = void 0;
- if (this.props.categories) {
- categoryTree = this.props.categories.items.map(function (cat, index) {
- return React.createElement(ExploreSideBarItem, {
- key: index,
- category: cat
- });
- });
- }
-
- return React.createElement(
- "aside",
- { className: "explore-left-sidebar", id: "left-sidebar" },
- React.createElement(
- "ul",
- null,
- React.createElement(
- "li",
- { className: "category-item" },
- React.createElement(
- "a",
- { className: this.props.categories.current === 0 ? "active" : "", href: "/browse/ord/" + filters.order },
- React.createElement(
- "span",
- { className: "title" },
- "All"
- )
- )
- ),
- categoryTree
- )
- );
- }
- }]);
-
- return ExploreLeftSideBar;
-}(React.Component);
-
-var mapStateToExploreLeftSideBarProps = function mapStateToExploreLeftSideBarProps(state) {
- var categories = state.categories;
- var filters = state.filters;
- return {
- categories: categories
- };
-};
-
-var mapDispatchToExploreLeftSideBarProps = function mapDispatchToExploreLeftSideBarProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var ExploreLeftSideBarWrapper = ReactRedux.connect(mapStateToExploreLeftSideBarProps, mapDispatchToExploreLeftSideBarProps)(ExploreLeftSideBar);
-
-var ExploreSideBarItem = function (_React$Component4) {
- _inherits(ExploreSideBarItem, _React$Component4);
-
- function ExploreSideBarItem() {
- _classCallCheck(this, ExploreSideBarItem);
-
- return _possibleConstructorReturn(this, (ExploreSideBarItem.__proto__ || Object.getPrototypeOf(ExploreSideBarItem)).apply(this, arguments));
- }
-
- _createClass(ExploreSideBarItem, [{
- key: "render",
- value: function render() {
- var order = store.getState().filters.order;
- var categories = store.getState().categories;
-
- var currentId = void 0,
- currentSubId = void 0,
- currentSecondSubId = void 0;
- if (categories.current) {
- currentId = categories.current.id;
- }
- if (categories.currentSub) {
- currentSubId = categories.currentSub.id;
- }
- if (categories.currentSecondSub) {
- currentSecondSubId = categories.currentSecondSub.id;
- }
-
- var active = void 0;
- if (currentId === this.props.category.id || currentSubId === this.props.category.id || currentSecondSubId === this.props.category.id) {
- active = true;
- }
-
- var subcatMenu = void 0;
- if (this.props.category.has_children === true && active) {
- var cArray = categoryHelpers.convertCatChildrenObjectToArray(this.props.category.children);
- var subcategories = cArray.map(function (cat, index) {
- return React.createElement(ExploreSideBarItem, {
- key: index,
- category: cat
- });
- });
- subcatMenu = React.createElement(
- "ul",
- null,
- subcategories
- );
- }
-
- return React.createElement(
- "li",
- { className: "category-item" },
- React.createElement(
- "a",
- { className: active === true ? "active" : "", href: "/browse/cat/" + this.props.category.id + "/ord/" + order + window.location.search },
- React.createElement(
- "span",
- { className: "title" },
- this.props.category.title
- ),
- React.createElement(
- "span",
- { className: "product-counter" },
- this.props.category.product_count
- )
- ),
- subcatMenu
- );
- }
- }]);
-
- return ExploreSideBarItem;
-}(React.Component);
-
-var Pagination = function (_React$Component5) {
- _inherits(Pagination, _React$Component5);
-
- function Pagination(props) {
- _classCallCheck(this, Pagination);
-
- var _this5 = _possibleConstructorReturn(this, (Pagination.__proto__ || Object.getPrototypeOf(Pagination)).call(this, props));
-
- _this5.state = {};
- return _this5;
- }
-
- _createClass(Pagination, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- var itemsPerPage = 50;
- var numPages = Math.ceil(this.props.pagination.totalcount / itemsPerPage);
- var pagination = productHelpers.generatePaginationObject(numPages, window.location.pathname, this.props.currentCategoy, this.props.filters.order, this.props.pagination.page);
- this.setState({ pagination: pagination }, function () {});
- }
- }, {
- key: "render",
- value: function render() {
- var _this6 = this;
-
- var paginationDisplay = void 0;
- if (this.state.pagination && this.props.pagination.totalcount > 50) {
- var pagination = this.state.pagination.map(function (pi, index) {
-
- var numberDisplay = void 0;
- if (pi.number === 'previous') {
- numberDisplay = React.createElement(
- "span",
- { className: "num-wrap" },
- React.createElement(
- "i",
- { className: "material-icons" },
- "arrow_back_ios"
- ),
- React.createElement(
- "span",
- null,
- pi.number
- )
- );
- } else if (pi.number === 'next') {
- numberDisplay = React.createElement(
- "span",
- { className: "num-wrap" },
- React.createElement(
- "span",
- null,
- pi.number
- ),
- React.createElement(
- "i",
- { className: "material-icons" },
- "arrow_forward_ios"
- )
- );
- } else {
- numberDisplay = pi.number;
- }
-
- var cssClass = void 0;
- if (pi.number === _this6.props.pagination.page) {
- cssClass = "active";
- }
-
- return React.createElement(
- "li",
- { key: index },
- React.createElement(
- "a",
- { href: pi.link, className: cssClass },
- numberDisplay
- )
- );
- });
- paginationDisplay = React.createElement(
- "ul",
- null,
- pagination
- );
- }
- return React.createElement(
- "div",
- { id: "pagination-container" },
- React.createElement(
- "div",
- { className: "wrapper" },
- paginationDisplay
- )
- );
- }
- }]);
-
- return Pagination;
-}(React.Component);
-
-var mapStateToPaginationProps = function mapStateToPaginationProps(state) {
- var pagination = state.pagination;
- var filters = state.filters;
- var currentCategoy = state.categories.current;
- return {
- pagination: pagination,
- filters: filters,
- currentCategoy: currentCategoy
- };
-};
-
-var mapDispatchToPaginationProps = function mapDispatchToPaginationProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var PaginationWrapper = ReactRedux.connect(mapStateToPaginationProps, mapDispatchToPaginationProps)(Pagination);
-
-var ExploreRightSideBar = function (_React$Component6) {
- _inherits(ExploreRightSideBar, _React$Component6);
-
- function ExploreRightSideBar(props) {
- _classCallCheck(this, ExploreRightSideBar);
-
- var _this7 = _possibleConstructorReturn(this, (ExploreRightSideBar.__proto__ || Object.getPrototypeOf(ExploreRightSideBar)).call(this, props));
-
- _this7.state = {};
- return _this7;
- }
-
- _createClass(ExploreRightSideBar, [{
- key: "render",
- value: function render() {
- return React.createElement(
- "aside",
- { className: "explore-right-sidebar" },
- React.createElement(
- "div",
- { className: "ers-section" },
- React.createElement(
- "a",
- { href: "https://www.opendesktop.org/p/1175480/", target: "_blank" },
- React.createElement("img", { id: "download-app", src: "/images/system/download-app.png" })
- )
- ),
- React.createElement(
- "div",
- { className: "ers-section" },
- React.createElement(
- "a",
- { href: "/support", id: "become-a-supporter", className: "mdl-button mdl-js-button mdl-button--colored mdl-button--raised mdl-js-ripple-effect mdl-color--primary" },
- "Become a supporter"
- )
- ),
- React.createElement(
- "div",
- { className: "ers-section" },
- React.createElement(ExploreSupportersContainerWrapper, null)
- ),
- React.createElement(
- "div",
- { className: "ers-section" },
- React.createElement(RssNewsContainer, null)
- ),
- React.createElement(
- "div",
- { className: "ers-section" },
- React.createElement(BlogFeedContainer, null)
- ),
- React.createElement(
- "div",
- { className: "ers-section" },
- React.createElement(ExploreCommentsContainerWrapper, null)
- ),
- React.createElement(
- "div",
- { className: "ers-section" },
- React.createElement(ExploreTopProductsWrapper, null)
- )
- );
- }
- }]);
-
- return ExploreRightSideBar;
-}(React.Component);
-
-var mapStateToExploreRightSideBarProps = function mapStateToExploreRightSideBarProps(state) {
- var categories = state.categories;
- var filters = state.filters;
- return {
- categories: categories
- };
-};
-
-var mapDispatchToExploreRightSideBarProps = function mapDispatchToExploreRightSideBarProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var ExploreRightSideBarWrapper = ReactRedux.connect(mapStateToExploreRightSideBarProps, mapDispatchToExploreRightSideBarProps)(ExploreRightSideBar);
-
-var ExploreSupportersContainer = function (_React$Component7) {
- _inherits(ExploreSupportersContainer, _React$Component7);
-
- function ExploreSupportersContainer(props) {
- _classCallCheck(this, ExploreSupportersContainer);
-
- var _this8 = _possibleConstructorReturn(this, (ExploreSupportersContainer.__proto__ || Object.getPrototypeOf(ExploreSupportersContainer)).call(this, props));
-
- _this8.state = {};
- return _this8;
- }
-
- _createClass(ExploreSupportersContainer, [{
- key: "render",
- value: function render() {
- var supportersContainer = void 0;
- if (this.props.supporters) {
- var cArray = categoryHelpers.convertCatChildrenObjectToArray(this.props.supporters);
- var supporters = cArray.map(function (sp, index) {
- return React.createElement(
- "div",
- { className: "supporter-item", key: index },
- React.createElement(
- "a",
- { href: "/member/" + sp.member_id, className: "item" },
- React.createElement("img", { src: sp.profile_image_url })
- )
- );
- });
- supportersContainer = React.createElement(
- "div",
- { className: "supporter-list-wrapper" },
- supporters
- );
- }
-
- return React.createElement(
- "div",
- { id: "supporters-container", className: "sidebar-feed-container" },
- React.createElement(
- "h3",
- null,
- this.props.supporters.length,
- " people support those who create freedom"
- ),
- supportersContainer
- );
- }
- }]);
-
- return ExploreSupportersContainer;
-}(React.Component);
-
-var mapStateToExploreSupportersContainerProps = function mapStateToExploreSupportersContainerProps(state) {
- var supporters = state.supporters;
- return {
- supporters: supporters
- };
-};
-
-var mapDispatchToExploreSupportersContainerProps = function mapDispatchToExploreSupportersContainerProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var ExploreSupportersContainerWrapper = ReactRedux.connect(mapStateToExploreSupportersContainerProps, mapDispatchToExploreSupportersContainerProps)(ExploreSupportersContainer);
-
-var RssNewsContainer = function (_React$Component8) {
- _inherits(RssNewsContainer, _React$Component8);
-
- function RssNewsContainer(props) {
- _classCallCheck(this, RssNewsContainer);
-
- var _this9 = _possibleConstructorReturn(this, (RssNewsContainer.__proto__ || Object.getPrototypeOf(RssNewsContainer)).call(this, props));
-
- _this9.state = {};
- return _this9;
- }
-
- _createClass(RssNewsContainer, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- var self = this;
- $.getJSON("https://blog.opendesktop.org/?json=1&callback=?", function (res) {
- self.setState({ items: res.posts });
- });
- }
- }, {
- key: "render",
- value: function render() {
- var feedItemsContainer = void 0;
- if (this.state.items) {
-
- var feedItems = this.state.items.slice(0, 3).map(function (fi, index) {
- return React.createElement(
- "li",
- { key: index },
- React.createElement(
- "a",
- { className: "title", href: fi.url },
- React.createElement(
- "span",
- null,
- fi.title
- )
- ),
- React.createElement(
- "span",
- { className: "info-row" },
- React.createElement(
- "span",
- { className: "date" },
- appHelpers.getTimeAgo(fi.date)
- ),
- React.createElement(
- "span",
- { className: "comment-counter" },
- fi.comment_count,
- " comments"
- )
- )
- );
- });
-
- feedItemsContainer = React.createElement(
- "ul",
- null,
- feedItems
- );
- }
- return React.createElement(
- "div",
- { id: "rss-new-container", className: "sidebar-feed-container" },
- React.createElement(
- "h3",
- null,
- "News"
- ),
- feedItemsContainer
- );
- }
- }]);
-
- return RssNewsContainer;
-}(React.Component);
-
-var BlogFeedContainer = function (_React$Component9) {
- _inherits(BlogFeedContainer, _React$Component9);
-
- function BlogFeedContainer(props) {
- _classCallCheck(this, BlogFeedContainer);
-
- var _this10 = _possibleConstructorReturn(this, (BlogFeedContainer.__proto__ || Object.getPrototypeOf(BlogFeedContainer)).call(this, props));
-
- _this10.state = {};
- return _this10;
- }
-
- _createClass(BlogFeedContainer, [{
- key: "componentDidMount",
- value: function componentDidMount() {
- var self = this;
- $.ajax("https://forum.opendesktop.org/latest.json").then(function (result) {
- var topics = result.topic_list.topics;
- topics.sort(function (a, b) {
- return new Date(b.last_posted_at) - new Date(a.last_posted_at);
- });
- topics = topics.slice(0, 3);
- self.setState({ items: topics });
- });
- }
- }, {
- key: "render",
- value: function render() {
- var feedItemsContainer = void 0;
- if (this.state.items) {
-
- var feedItems = this.state.items.map(function (fi, index) {
- return React.createElement(
- "li",
- { key: index },
- React.createElement(
- "a",
- { className: "title", href: "https://forum.opendesktop.org//t/" + fi.id },
- React.createElement(
- "span",
- null,
- fi.title
- )
- ),
- React.createElement(
- "span",
- { className: "info-row" },
- React.createElement(
- "span",
- { className: "date" },
- appHelpers.getTimeAgo(fi.created_at)
- ),
- React.createElement(
- "span",
- { className: "comment-counter" },
- fi.reply_count,
- " replies"
- )
- )
- );
- });
-
- feedItemsContainer = React.createElement(
- "ul",
- null,
- feedItems
- );
- }
- return React.createElement(
- "div",
- { id: "blog-feed-container", className: "sidebar-feed-container" },
- React.createElement(
- "h3",
- null,
- "Forum"
- ),
- feedItemsContainer
- );
- }
- }]);
-
- return BlogFeedContainer;
-}(React.Component);
-
-var ExploreCommentsContainer = function (_React$Component10) {
- _inherits(ExploreCommentsContainer, _React$Component10);
-
- function ExploreCommentsContainer(props) {
- _classCallCheck(this, ExploreCommentsContainer);
-
- var _this11 = _possibleConstructorReturn(this, (ExploreCommentsContainer.__proto__ || Object.getPrototypeOf(ExploreCommentsContainer)).call(this, props));
-
- _this11.state = {};
- return _this11;
- }
-
- _createClass(ExploreCommentsContainer, [{
- key: "render",
- value: function render() {
- var commentsContainer = void 0;
- if (this.props.comments) {
- var comments = this.props.comments.map(function (cm, index) {
- return React.createElement(
- "li",
- { key: index },
- React.createElement(
- "div",
- { className: "cm-content" },
- React.createElement(
- "span",
- { className: "cm-userinfo" },
- React.createElement("img", { src: cm.profile_image_url }),
- React.createElement(
- "span",
- { className: "username" },
- React.createElement(
- "a",
- { href: "/p/" + cm.comment_target_id },
- cm.username
- )
- )
- ),
- React.createElement(
- "a",
- { className: "title", href: "/member/" + cm.member_id },
- React.createElement(
- "span",
- null,
- cm.title
- )
- ),
- React.createElement(
- "span",
- { className: "content" },
- cm.comment_text
- ),
- React.createElement(
- "span",
- { className: "info-row" },
- React.createElement(
- "span",
- { className: "date" },
- appHelpers.getTimeAgo(cm.comment_created_at)
- )
- )
- )
- );
- });
- commentsContainer = React.createElement(
- "ul",
- null,
- comments
- );
- }
- return React.createElement(
- "div",
- { id: "blog-feed-container", className: "sidebar-feed-container" },
- React.createElement(
- "h3",
- null,
- "Forum"
- ),
- commentsContainer
- );
- }
- }]);
-
- return ExploreCommentsContainer;
-}(React.Component);
-
-var mapStateToExploreCommentsContainerProps = function mapStateToExploreCommentsContainerProps(state) {
- var comments = state.comments;
- return {
- comments: comments
- };
-};
-
-var mapDispatchToExploreCommentsContainerProps = function mapDispatchToExploreCommentsContainerProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var ExploreCommentsContainerWrapper = ReactRedux.connect(mapStateToExploreCommentsContainerProps, mapDispatchToExploreCommentsContainerProps)(ExploreCommentsContainer);
-
-var ExploreTopProducts = function (_React$Component11) {
- _inherits(ExploreTopProducts, _React$Component11);
-
- function ExploreTopProducts(props) {
- _classCallCheck(this, ExploreTopProducts);
-
- var _this12 = _possibleConstructorReturn(this, (ExploreTopProducts.__proto__ || Object.getPrototypeOf(ExploreTopProducts)).call(this, props));
-
- _this12.state = {};
- return _this12;
- }
-
- _createClass(ExploreTopProducts, [{
- key: "render",
- value: function render() {
- var topProductsContainer = void 0;
- if (this.props.topProducts) {
-
- var imageBaseUrl = void 0;
- if (store.getState().env === 'live') {
- imageBaseUrl = 'cn.opendesktop.org';
- } else {
- imageBaseUrl = 'cn.pling.it';
- }
-
- var topProducts = this.props.topProducts.map(function (tp, index) {
- return React.createElement(
- "li",
- { key: index },
- React.createElement("img", { src: "https://" + imageBaseUrl + "/cache/40x40/img/" + tp.image_small }),
- React.createElement(
- "a",
- { href: "/p/" + tp.project_id },
- tp.title
- ),
- React.createElement(
- "span",
- { className: "cat-name" },
- tp.cat_title
- )
- );
- });
-
- topProductsContainer = React.createElement(
- "ol",
- null,
- topProducts
- );
- }
- return React.createElement(
- "div",
- { id: "top-products-container", className: "sidebar-feed-container" },
- React.createElement(
- "h3",
- null,
- "3 Months Ranking"
- ),
- React.createElement(
- "small",
- null,
- "(based on downloads)"
- ),
- topProductsContainer
- );
- }
- }]);
-
- return ExploreTopProducts;
-}(React.Component);
-
-var mapStateToExploreTopProductsProps = function mapStateToExploreTopProductsProps(state) {
- var topProducts = state.topProducts;
- return {
- topProducts: topProducts
- };
-};
-
-var mapDispatchToExploreTopProductsProps = function mapDispatchToExploreTopProductsProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var ExploreTopProductsWrapper = ReactRedux.connect(mapStateToExploreTopProductsProps, mapDispatchToExploreTopProductsProps)(ExploreTopProducts);
-"use strict";
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var HomePage = function (_React$Component) {
- _inherits(HomePage, _React$Component);
-
- function HomePage(props) {
- _classCallCheck(this, HomePage);
-
- var _this = _possibleConstructorReturn(this, (HomePage.__proto__ || Object.getPrototypeOf(HomePage)).call(this, props));
-
- _this.state = {
- device: store.getState().device,
- products: store.getState().products
- };
- return _this;
- }
-
- _createClass(HomePage, [{
- key: "componentWillReceiveProps",
- value: function componentWillReceiveProps(nextProps) {
- if (nextProps.device) {
- this.setState({ device: nextProps.device });
- }
- if (nextProps.products) {
- this.setState({ products: nextProps.products });
- }
- }
- }, {
- key: "render",
- value: function render() {
- return React.createElement(
- "div",
- { id: "homepage" },
- React.createElement(
- "div",
- { className: "hp-wrapper" },
- React.createElement(Introduction, {
- device: this.state.device,
- count: window.totalProjects
- })
- )
- );
- }
- }]);
-
- return HomePage;
-}(React.Component);
-
-var mapStateToHomePageProps = function mapStateToHomePageProps(state) {
- var device = state.device;
- var products = state.products;
- return {
- device: device,
- products: products
- };
-};
-
-var mapDispatchToHomePageProps = function mapDispatchToHomePageProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var HomePageWrapper = ReactRedux.connect(mapStateToHomePageProps, mapDispatchToHomePageProps)(HomePage);
-
-var Introduction = function (_React$Component2) {
- _inherits(Introduction, _React$Component2);
-
- function Introduction() {
- _classCallCheck(this, Introduction);
-
- return _possibleConstructorReturn(this, (Introduction.__proto__ || Object.getPrototypeOf(Introduction)).apply(this, arguments));
- }
-
- _createClass(Introduction, [{
- key: "render",
- value: function render() {
-
- var introductionText = void 0,
- siteTitle = void 0,
- buttonsContainer = void 0;
- if (window.page === "appimages") {
- siteTitle = "AppImageHub";
- introductionText = React.createElement(
- "p",
- null,
- "This catalog has ",
- this.props.count,
- " AppImages and counting.",
- React.createElement("br", null),
- "AppImages are self-contained apps which can simply be downloaded & run on any Linux distribution. For easy integration, download AppImageLauncher:"
- );
- buttonsContainer = React.createElement(
- "div",
- { className: "actions" },
- React.createElement(
- "a",
- { href: "/p/1228228", className: "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored mdl-color--primary" },
- React.createElement("img", { src: "/theme/react/assets/img/icon-download_white.png" }),
- " AppImageLauncher"
- ),
- React.createElement(
- "a",
- { href: "/browse", className: "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored mdl-color--primary" },
- "Browse all apps"
- ),
- React.createElement(
- "a",
- { href: "https://chat.opendesktop.org/#/room/#appimagehub:chat.opendesktop.org", className: "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored mdl-color--primary", style: { "margin-left": "50px" } },
- "Join our chat #AppImageHub"
- )
- );
- } else if (window.page === "libreoffice") {
- siteTitle = "LibreOffice";
- introductionText = React.createElement(
- "p",
- null,
- "Extensions add new features to your LibreOffice or make the use of already existing ones easier. Currently there are ",
- this.props.count,
- " project(s) available."
- );
- buttonsContainer = React.createElement(
- "div",
- { className: "actions green" },
- React.createElement(
- "a",
- { href: window.baseUrl + "product/add", className: "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored mdl-color--primary" },
- "Add Extension"
- ),
- React.createElement(
- "a",
- { href: window.baseUrl + "browse/", className: "mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored mdl-color--primary" },
- "Browse all Extensions"
- )
- );
- }
-
- return React.createElement(
- "div",
- { id: "introduction", className: "section" },
- React.createElement(
- "div",
- { className: "container" },
- React.createElement(
- "article",
- null,
- React.createElement(
- "h2",
- { className: "mdl-color-text--primary" },
- "Welcome to ",
- siteTitle
- ),
- introductionText,
- buttonsContainer
- )
- )
- );
- }
- }]);
-
- return Introduction;
-}(React.Component);
-
-var HpIntroSection = function (_React$Component3) {
- _inherits(HpIntroSection, _React$Component3);
-
- function HpIntroSection(props) {
- _classCallCheck(this, HpIntroSection);
-
- var _this3 = _possibleConstructorReturn(this, (HpIntroSection.__proto__ || Object.getPrototypeOf(HpIntroSection)).call(this, props));
-
- _this3.state = {};
- return _this3;
- }
-
- _createClass(HpIntroSection, [{
- key: "render",
- value: function render() {
- return React.createElement(
- "div",
- { id: "homepage-search-container", className: "section intro" },
- React.createElement(
- "div",
- { className: "container" },
- React.createElement(
- "article",
- null,
- React.createElement(
- "p",
- null,
- "Search thousands of snaps used by millions of people across 50 Linux distributions"
- )
- ),
- React.createElement(
- "div",
- { id: "hp-search-form-container" },
- React.createElement(
- "select",
- { className: "mdl-selectfield__select" },
- React.createElement(
- "option",
- null,
- "categories"
- )
- ),
- React.createElement("input", { type: "text" }),
- React.createElement(
- "button",
- null,
- "search"
- )
- )
- )
- );
- }
- }]);
-
- return HpIntroSection;
-}(React.Component);
-
-var mapStateToHpIntroSectionProps = function mapStateToHpIntroSectionProps(state) {
- var categories = state.categories;
- return {
- categories: categories
- };
-};
-
-var mapDispatchToHpIntroSectionProps = function mapDispatchToHpIntroSectionProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var HpIntroSectionWrapper = ReactRedux.connect(mapStateToHpIntroSectionProps, mapDispatchToHpIntroSectionProps)(HpIntroSection);
-
-var ProductCarousel = function (_React$Component4) {
- _inherits(ProductCarousel, _React$Component4);
-
- function ProductCarousel(props) {
- _classCallCheck(this, ProductCarousel);
-
- var _this4 = _possibleConstructorReturn(this, (ProductCarousel.__proto__ || Object.getPrototypeOf(ProductCarousel)).call(this, props));
-
- _this4.state = {
- showRightArrow: true,
- showLeftArrow: false
- };
- _this4.updateDimensions = _this4.updateDimensions.bind(_this4);
- _this4.animateProductCarousel = _this4.animateProductCarousel.bind(_this4);
- return _this4;
- }
-
- _createClass(ProductCarousel, [{
- key: "componentWillMount",
- value: function componentWillMount() {
- window.addEventListener("resize", this.updateDimensions);
- }
- }, {
- key: "componentDidMount",
- value: function componentDidMount() {
- this.updateDimensions();
- }
- }, {
- key: "updateDimensions",
- value: function updateDimensions() {
- var containerWidth = $('#introduction').find('.container').width();
- var sliderWidth = containerWidth * 3;
- var itemWidth = containerWidth / 5;
- this.setState({
- sliderPosition: 0,
- containerWidth: containerWidth,
- sliderWidth: sliderWidth,
- itemWidth: itemWidth
- });
- }
- }, {
- key: "animateProductCarousel",
- value: function animateProductCarousel(dir) {
-
- var newSliderPosition = this.state.sliderPosition;
- if (dir === 'left') {
- newSliderPosition = this.state.sliderPosition - this.state.containerWidth;
- } else {
- newSliderPosition = this.state.sliderPosition + this.state.containerWidth;
- }
-
- this.setState({ sliderPosition: newSliderPosition }, function () {
-
- var showLeftArrow = true,
- showRightArrow = true;
- var endPoint = this.state.sliderWidth - this.state.containerWidth;
- if (this.state.sliderPosition <= 0) {
- showLeftArrow = false;
- }
- if (this.state.sliderPosition >= endPoint) {
- showRightArrow = false;
- }
-
- this.setState({
- showLeftArrow: showLeftArrow,
- showRightArrow: showRightArrow
- });
- });
- }
- }, {
- key: "render",
- value: function render() {
- var _this5 = this;
-
- var carouselItemsDisplay = void 0;
- if (this.props.products && this.props.products.length > 0) {
- carouselItemsDisplay = this.props.products.map(function (product, index) {
- return React.createElement(ProductCarouselItem, {
- key: index,
- product: product,
- itemWidth: _this5.state.itemWidth
- });
- });
- }
-
- var rightArrowDisplay = void 0,
- leftArrowDisplay = void 0;
- if (this.state.showLeftArrow) {
- leftArrowDisplay = React.createElement(
- "div",
- { className: "product-carousel-left" },
- React.createElement(
- "a",
- { onClick: function onClick() {
- return _this5.animateProductCarousel('left');
- }, className: "carousel-arrow arrow-left" },
- React.createElement(
- "i",
- { className: "material-icons" },
- "chevron_left"
- )
- )
- );
- }
- if (this.state.showRightArrow) {
- rightArrowDisplay = React.createElement(
- "div",
- { className: "product-carousel-right" },
- React.createElement(
- "a",
- { onClick: function onClick() {
- return _this5.animateProductCarousel('right');
- }, className: "carousel-arrow arrow-right" },
- React.createElement(
- "i",
- { className: "material-icons" },
- "chevron_right"
- )
- )
- );
- }
-
- return React.createElement(
- "div",
- { className: "product-carousel" },
- React.createElement(
- "div",
- { className: "product-carousel-header" },
- React.createElement(
- "h2",
- null,
- React.createElement(
- "a",
- { href: this.props.link },
- this.props.title,
- React.createElement(
- "i",
- { className: "material-icons" },
- "chevron_right"
- )
- )
- )
- ),
- React.createElement(
- "div",
- { className: "product-carousel-wrapper" },
- leftArrowDisplay,
- React.createElement(
- "div",
- { className: "product-carousel-container" },
- React.createElement(
- "div",
- { className: "product-carousel-slider", style: { "width": this.state.sliderWidth, "left": "-" + this.state.sliderPosition + "px" } },
- carouselItemsDisplay
- )
- ),
- rightArrowDisplay
- )
- );
- }
- }]);
-
- return ProductCarousel;
-}(React.Component);
-
-var ProductCarouselItem = function (_React$Component5) {
- _inherits(ProductCarouselItem, _React$Component5);
-
- function ProductCarouselItem(props) {
- _classCallCheck(this, ProductCarouselItem);
-
- var _this6 = _possibleConstructorReturn(this, (ProductCarouselItem.__proto__ || Object.getPrototypeOf(ProductCarouselItem)).call(this, props));
-
- _this6.state = {};
- return _this6;
- }
-
- _createClass(ProductCarouselItem, [{
- key: "render",
- value: function render() {
- var imageBaseUrl = void 0;
- if (store.getState().env === 'live') {
- imageBaseUrl = 'cn.opendesktop.org';
- } else {
- imageBaseUrl = 'cn.pling.it';
- }
- return React.createElement(
- "div",
- { className: "product-carousel-item", style: { "width": this.props.itemWidth } },
- React.createElement(
- "a",
- { href: "/p/" + this.props.product.project_id },
- React.createElement(
- "figure",
- null,
- React.createElement("img", { className: "very-rounded-corners", src: 'https://' + imageBaseUrl + '/cache/200x171/img/' + this.props.product.image_small })
- ),
- React.createElement(
- "div",
- { className: "product-info" },
- React.createElement(
- "span",
- { className: "product-info-title" },
- this.props.product.title
- ),
- React.createElement(
- "span",
- { className: "product-info-user" },
- this.props.product.username
- )
- )
- )
- );
- }
- }]);
-
- return ProductCarouselItem;
-}(React.Component);
-'use strict';
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var ProductView = function (_React$Component) {
- _inherits(ProductView, _React$Component);
-
- function ProductView(props) {
- _classCallCheck(this, ProductView);
-
- var _this = _possibleConstructorReturn(this, (ProductView.__proto__ || Object.getPrototypeOf(ProductView)).call(this, props));
-
- _this.state = {
- tab: 'comments',
- showDownloadSection: false
- };
- _this.toggleTab = _this.toggleTab.bind(_this);
- _this.toggleDownloadSection = _this.toggleDownloadSection.bind(_this);
- return _this;
- }
-
- _createClass(ProductView, [{
- key: 'componentDidMount',
- value: function componentDidMount() {
- var downloadTableHeight = $('#product-download-section').find('#files-tab').height();
- downloadTableHeight += 80;
- this.setState({ downloadTableHeight: downloadTableHeight });
- }
- }, {
- key: 'componentWillReceiveProps',
- value: function componentWillReceiveProps(nextProps) {
- if (nextProps.product !== this.props.product) {
- this.forceUpdate();
- }
- if (nextProps.lightboxGallery !== this.props.lightboxGallery) {
- this.forceUpdate();
- }
- }
- }, {
- key: 'toggleTab',
- value: function toggleTab(tab) {
- this.setState({ tab: tab });
- }
- }, {
- key: 'toggleDownloadSection',
- value: function toggleDownloadSection() {
- var showDownloadSection = this.state.showDownloadSection === true ? false : true;
- this.setState({ showDownloadSection: showDownloadSection });
- }
- }, {
- key: 'render',
- value: function render() {
-
- var productGalleryDisplay = void 0;
- if (this.props.product.r_gallery.length > 0) {
- productGalleryDisplay = React.createElement(ProductViewGallery, {
- product: this.props.product
- });
- }
-
- var productGalleryLightboxDisplay = void 0;
- if (this.props.lightboxGallery.show === true) {
- productGalleryLightboxDisplay = React.createElement(ProductGalleryLightbox, {
- product: this.props.product
- });
- }
-
- var downloadSectionDisplayHeight = void 0;
- if (this.state.showDownloadSection === true) {
- downloadSectionDisplayHeight = this.state.downloadTableHeight;
- }
-
- return React.createElement(
- 'div',
- { id: 'product-page' },
- React.createElement(
- 'div',
- { id: 'product-download-section', style: { "height": downloadSectionDisplayHeight } },
- React.createElement(ProductViewFilesTab, {
- product: this.props.product,
- files: this.props.product.r_files
- })
- ),
- React.createElement(ProductViewHeader, {
- product: this.props.product,
- user: this.props.user,
- onDownloadBtnClick: this.toggleDownloadSection
- }),
- productGalleryDisplay,
- React.createElement(ProductDescription, {
- product: this.props.product
- }),
- React.createElement(ProductNavBar, {
- onTabToggle: this.toggleTab,
- tab: this.state.tab,
- product: this.props.product
- }),
- React.createElement(ProductViewContent, {
- product: this.props.product,
- user: this.props.user,
- tab: this.state.tab
- }),
- productGalleryLightboxDisplay
- );
- }
- }]);
-
- return ProductView;
-}(React.Component);
-
-var mapStateToProductPageProps = function mapStateToProductPageProps(state) {
- var product = state.product;
- var user = state.user;
- var lightboxGallery = state.lightboxGallery;
- return {
- product: product,
- user: user,
- lightboxGallery: lightboxGallery
- };
-};
-
-var mapDispatchToProductPageProps = function mapDispatchToProductPageProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var ProductViewWrapper = ReactRedux.connect(mapStateToProductPageProps, mapDispatchToProductPageProps)(ProductView);
-
-var ProductViewHeader = function (_React$Component2) {
- _inherits(ProductViewHeader, _React$Component2);
-
- function ProductViewHeader(props) {
- _classCallCheck(this, ProductViewHeader);
-
- var _this2 = _possibleConstructorReturn(this, (ProductViewHeader.__proto__ || Object.getPrototypeOf(ProductViewHeader)).call(this, props));
-
- _this2.state = {};
- return _this2;
- }
-
- _createClass(ProductViewHeader, [{
- key: 'render',
- value: function render() {
-
- var imageBaseUrl = void 0;
- if (store.getState().env === 'live') {
- imageBaseUrl = 'cn.opendesktop.org';
- } else {
- imageBaseUrl = 'cn.pling.it';
- }
-
- var productTagsDisplay = void 0;
- if (this.props.product.r_tags_user) {
- var tagsArray = this.props.product.r_tags_user.split(',');
- var tags = tagsArray.map(function (tag, index) {
- return React.createElement(
- 'span',
- { className: 'mdl-chip', key: index },
- React.createElement(
- 'span',
- { className: 'mdl-chip__text' },
- React.createElement('span', { className: 'glyphicon glyphicon-tag' }),
- React.createElement(
- 'a',
- { href: "search/projectSearchText/" + tag + "/f/tags" },
- tag
- )
- )
- );
- });
- productTagsDisplay = React.createElement(
- 'div',
- { className: 'product-tags' },
- tags
- );
- }
-
- return React.createElement(
- 'div',
- { className: 'wrapper', id: 'product-view-header' },
- React.createElement(
- 'div',
- { className: 'container' },
- React.createElement(
- 'div',
- { className: 'section mdl-grid' },
- React.createElement(
- 'div',
- { className: 'product-view-header-left' },
- React.createElement(
- 'figure',
- { className: 'image-container' },
- React.createElement('img', { src: 'https://' + imageBaseUrl + '/cache/140x140/img/' + this.props.product.image_small })
- ),
- React.createElement(
- 'div',
- { className: 'product-info' },
- React.createElement(
- 'h1',
- null,
- this.props.product.title
- ),
- React.createElement(
- 'div',
- { className: 'info-row' },
- React.createElement(
- 'a',
- { className: 'user', href: "/member/" + this.props.product.member_id },
- React.createElement(
- 'span',
- { className: 'avatar' },
- React.createElement('img', { src: this.props.product.profile_image_url })
- ),
- React.createElement(
- 'span',
- { className: 'username' },
- this.props.product.username
- )
- ),
- React.createElement(
- 'a',
- { href: "/browse/cat/" + this.props.product.project_category_id + "/order/latest?new=1" },
- React.createElement(
- 'span',
- null,
- this.props.product.cat_title
- )
- ),
- productTagsDisplay
- )
- )
- ),
- React.createElement(
- 'div',
- { className: 'product-view-header-right' },
- React.createElement(
- 'div',
- { className: 'details-container' },
- React.createElement(
- 'a',
- { onClick: this.props.onDownloadBtnClick, href: '#', className: 'mdl-button mdl-js-button mdl-button--colored mdl-button--raised mdl-js-ripple-effect mdl-color--primary' },
- 'Download'
- ),
- React.createElement(ProductViewHeaderLikes, {
- product: this.props.product,
- user: this.props.user
- }),
- React.createElement(
- 'div',
- { id: 'product-view-header-right-side' },
- React.createElement(ProductViewHeaderRatings, {
- product: this.props.product,
- user: this.props.user
- })
- )
- )
- )
- )
- )
- );
- }
- }]);
-
- return ProductViewHeader;
-}(React.Component);
-
-var ProductViewHeaderLikes = function (_React$Component3) {
- _inherits(ProductViewHeaderLikes, _React$Component3);
-
- function ProductViewHeaderLikes(props) {
- _classCallCheck(this, ProductViewHeaderLikes);
-
- var _this3 = _possibleConstructorReturn(this, (ProductViewHeaderLikes.__proto__ || Object.getPrototypeOf(ProductViewHeaderLikes)).call(this, props));
-
- _this3.state = {};
- _this3.onUserLike = _this3.onUserLike.bind(_this3);
- return _this3;
- }
-
- _createClass(ProductViewHeaderLikes, [{
- key: 'componentDidMount',
- value: function componentDidMount() {
- var user = store.getState().user;
- var likedByUser = productHelpers.checkIfLikedByUser(user, this.props.product.r_likes);
- this.setState({ likesTotal: this.props.product.r_likes.length, likedByUser: likedByUser });
- }
- }, {
- key: 'onUserLike',
- value: function onUserLike() {
- if (this.props.user.username) {
- var url = "/p/" + this.props.product.project_id + "/followproject/";
- var self = this;
- $.ajax({ url: url, cache: false }).done(function (response) {
- // error
- if (response.status === "error") {
- self.setState({ msg: response.msg });
- } else {
- // delete
- if (response.action === "delete") {
- var likesTotal = self.state.likesTotal - 1;
- self.setState({ likesTotal: likesTotal, likedByUser: false });
- }
- // insert
- else {
- var _likesTotal = self.state.likesTotal + 1;
- self.setState({ likesTotal: _likesTotal, likedByUser: true });
- }
- }
- });
- } else {
- this.setState({ msg: 'please login to like' });
- }
- }
- }, {
- key: 'render',
- value: function render() {
- var cssContainerClass = void 0,
- cssHeartClass = void 0;
- if (this.state.likedByUser === true) {
- cssContainerClass = "liked-by-user";
- cssHeartClass = "plingheart fa heartproject fa-heart";
- } else {
- cssHeartClass = "plingheart fa fa-heart-o heartgrey";
- }
-
- return React.createElement(
- 'div',
- { className: cssContainerClass, id: 'likes-container' },
- React.createElement(
- 'div',
- { className: 'likes' },
- React.createElement('i', { className: cssHeartClass }),
- React.createElement(
- 'span',
- { onClick: this.onUserLike },
- this.state.likesTotal
- )
- ),
- React.createElement(
- 'div',
- { className: 'likes-label-container' },
- this.state.msg
- )
- );
- }
- }]);
-
- return ProductViewHeaderLikes;
-}(React.Component);
-
-var ProductViewHeaderRatings = function (_React$Component4) {
- _inherits(ProductViewHeaderRatings, _React$Component4);
-
- function ProductViewHeaderRatings(props) {
- _classCallCheck(this, ProductViewHeaderRatings);
-
- var _this4 = _possibleConstructorReturn(this, (ProductViewHeaderRatings.__proto__ || Object.getPrototypeOf(ProductViewHeaderRatings)).call(this, props));
-
- _this4.state = {
- userIsOwner: '',
- action: '',
- laplace_score: _this4.props.product.laplace_score
- };
- _this4.onRatingFormResponse = _this4.onRatingFormResponse.bind(_this4);
- return _this4;
- }
-
- _createClass(ProductViewHeaderRatings, [{
- key: 'componentDidMount',
- value: function componentDidMount() {
-
- var userIsOwner = false;
- if (this.props.user && this.props.user.member_id === this.props.product.member_id) {
- userIsOwner = true;
- }
- var userRating = -1;
- if (userIsOwner === false) {
- userRating = productHelpers.getLoggedUserRatingOnProduct(this.props.user, this.props.product.r_ratings);
- }
- this.setState({ userIsOwner: userIsOwner, userRating: userRating });
- }
- }, {
- key: 'onRatingBtnClick',
- value: function onRatingBtnClick(action) {
- this.setState({ showModal: false }, function () {
- this.setState({ action: action, showModal: true }, function () {
- $('#ratings-form-modal').modal('show');
- });
- });
- }
- }, {
- key: 'onRatingFormResponse',
- value: function onRatingFormResponse(modalResponse, val) {
- var self = this;
- this.setState({ errorMsg: '' }, function () {
- jQuery.ajax({
- data: {},
- url: '/p/' + this.props.product.project_id + '/loadratings/',
- method: 'get',
- error: function error(jqXHR, textStatus, errorThrown) {
- self.setState({ errorMsg: textStatus + " " + errorThrown });
- $('#ratings-form-modal').modal('hide');
- },
- success: function success(response) {
- // const laplace_score = productHelpers.calculateProductLaplaceScore(response);
- store.dispatch(setProductRatings(response));
- if (modalResponse.status !== "ok") self.setState({ errorMsg: modalResponse.status + " - " + modalResponse.message });
- self.setState({ laplace_score: modalResponse.laplace_score }, function () {});
- $('#ratings-form-modal').modal('hide');
- }
- });
- });
- }
- }, {
- key: 'render',
- value: function render() {
- var _this5 = this;
-
- var ratingsFormModalDisplay = void 0;
- if (this.state.showModal === true) {
- if (this.props.user.username) {
- ratingsFormModalDisplay = React.createElement(RatingsFormModal, {
- user: this.props.user,
- userIsOwner: this.state.userIsOwner,
- userRating: this.state.userRating,
- action: this.state.action,
- product: this.props.product,
- onRatingFormResponse: this.onRatingFormResponse
- });
- } else {
- ratingsFormModalDisplay = React.createElement(
- 'div',
- { className: 'modal please-login', id: 'ratings-form-modal', tabIndex: '-1', role: 'dialog' },
- React.createElement(
- 'div',
- { className: 'modal-dialog', role: 'document' },
- React.createElement(
- 'div',
- { className: 'modal-content' },
- React.createElement(
- 'div',
- { className: 'modal-header' },
- React.createElement(
- 'h4',
- { className: 'modal-title' },
- 'Please Login'
- ),
- React.createElement(
- 'button',
- { type: 'button', id: 'review-modal-close', className: 'close', 'data-dismiss': 'modal', 'aria-label': 'Close' },
- React.createElement(
- 'span',
- { 'aria-hidden': 'true' },
- '\xD7'
- )
- )
- ),
- React.createElement(
- 'div',
- { className: 'modal-body' },
- React.createElement(
- 'a',
- { href: '/login/' },
- 'Login'
- )
- )
- )
- )
- );
- }
- }
-
- return React.createElement(
- 'div',
- { className: 'ratings-bar-container' },
- React.createElement(
- 'div',
- { className: 'ratings-bar-left', onClick: function onClick() {
- return _this5.onRatingBtnClick('minus');
- } },
- React.createElement(
- 'i',
- { className: 'material-icons' },
- 'remove'
- )
- ),
- React.createElement(
- 'div',
- { className: 'ratings-bar-holder' },
- React.createElement('div', { className: 'green ratings-bar', style: { "width": this.state.laplace_score + "%" } }),
- React.createElement('div', { className: 'ratings-bar-empty', style: { "width": 100 - this.state.laplace_score + "%" } })
- ),
- React.createElement(
- 'div',
- { className: 'ratings-bar-right', onClick: function onClick() {
- return _this5.onRatingBtnClick('plus');
- } },
- React.createElement(
- 'i',
- { className: 'material-icons' },
- 'add'
- )
- ),
- ratingsFormModalDisplay,
- React.createElement(
- 'p',
- { className: 'ratings-bar-error-msg-container' },
- this.state.errorMsg
- )
- );
- }
- }]);
-
- return ProductViewHeaderRatings;
-}(React.Component);
-
-var RatingsFormModal = function (_React$Component5) {
- _inherits(RatingsFormModal, _React$Component5);
-
- function RatingsFormModal(props) {
- _classCallCheck(this, RatingsFormModal);
-
- var _this6 = _possibleConstructorReturn(this, (RatingsFormModal.__proto__ || Object.getPrototypeOf(RatingsFormModal)).call(this, props));
-
- _this6.state = {
- action: _this6.props.action
- };
- _this6.submitRatingForm = _this6.submitRatingForm.bind(_this6);
- _this6.onTextAreaInputChange = _this6.onTextAreaInputChange.bind(_this6);
- return _this6;
- }
-
- _createClass(RatingsFormModal, [{
- key: 'componentDidMount',
- value: function componentDidMount() {
- var actionIcon = void 0;
- if (this.props.action === 'plus') {
- actionIcon = '+';
- } else if (this.props.action === 'minus') {
- actionIcon = '-';
- }
- this.setState({ action: this.props.action, actionIcon: actionIcon, text: actionIcon }, function () {
- this.forceUpdate();
- });
- }
- }, {
- key: 'onTextAreaInputChange',
- value: function onTextAreaInputChange(e) {
- this.setState({ text: e.target.value });
- }
- }, {
- key: 'submitRatingForm',
- value: function submitRatingForm() {
- this.setState({ loading: true }, function () {
- var self = this;
- var v = void 0;
- if (this.state.action === 'plus') {
- v = '1';
- } else {
- v = '2';
- }
-
- jQuery.ajax({
- data: {
- p: this.props.product.project_id,
- m: this.props.user.member_id,
- v: v,
- pm: this.props.product.member_id,
- otxt: this.state.text,
- userrate: this.props.userRating,
- msg: this.state.text
- },
- url: '/productcomment/addreplyreview/',
- method: 'post',
- error: function error() {
- var msg = "Service is temporarily unavailable. Our engineers are working quickly to resolve this issue. Find out why you may have encountered this error.";
- self.setState({ msg: msg });
- },
- success: function success(response) {
- self.props.onRatingFormResponse(response, v);
- }
- });
- });
- }
- }, {
- key: 'render',
- value: function render() {
- var textAreaDisplay = void 0,
- modalBtnDisplay = void 0;
- if (!this.props.user) {
- textAreaDisplay = React.createElement(
- 'p',
- null,
- 'Please login to comment'
- );
- modalBtnDisplay = React.createElement(
- 'button',
- { type: 'button', className: 'btn btn-secondary', 'data-dismiss': 'modal' },
- 'Close'
- );
- } else {
- if (this.props.userIsOwner) {
- textAreaDisplay = React.createElement(
- 'p',
- null,
- 'Project owner not allowed'
- );
- modalBtnDisplay = React.createElement(
- 'button',
- { type: 'button', className: 'btn btn-secondary', 'data-dismiss': 'modal' },
- 'Close'
- );
- } else if (this.state.text) {
- textAreaDisplay = React.createElement('textarea', { onChange: this.onTextAreaInputChange, defaultValue: this.state.text, className: 'form-control' });
- if (this.state.loading !== true) {
-
- if (this.state.msg) {
- modalBtnDisplay = React.createElement(
- 'p',
- null,
- this.state.msg
- );
- } else {
- modalBtnDisplay = React.createElement(
- 'button',
- { onClick: this.submitRatingForm, type: 'button', className: 'btn btn-primary' },
- 'Rate Now'
- );
- }
- } else {
- modalBtnDisplay = React.createElement('span', { className: 'glyphicon glyphicon-refresh spinning' });
- }
- }
- }
-
- return React.createElement(
- 'div',
- { className: 'modal', id: 'ratings-form-modal', tabIndex: '-1', role: 'dialog' },
- React.createElement(
- 'div',
- { className: 'modal-dialog', role: 'document' },
- React.createElement(
- 'div',
- { className: 'modal-content' },
- React.createElement(
- 'div',
- { className: 'modal-header' },
- React.createElement(
- 'div',
- { className: this.props.action + " action-icon-container" },
- this.state.actionIcon
- ),
- React.createElement(
- 'h5',
- { className: 'modal-title' },
- 'Add Comment (min. 1 char):'
- ),
- React.createElement(
- 'button',
- { type: 'button', id: 'review-modal-close', className: 'close', 'data-dismiss': 'modal', 'aria-label': 'Close' },
- React.createElement(
- 'span',
- { 'aria-hidden': 'true' },
- '\xD7'
- )
- )
- ),
- React.createElement(
- 'div',
- { className: 'modal-body' },
- textAreaDisplay
- ),
- React.createElement(
- 'div',
- { className: 'modal-footer' },
- modalBtnDisplay
- )
- )
- )
- );
- }
- }]);
-
- return RatingsFormModal;
-}(React.Component);
-
-var ProductViewGallery = function (_React$Component6) {
- _inherits(ProductViewGallery, _React$Component6);
-
- function ProductViewGallery(props) {
- _classCallCheck(this, ProductViewGallery);
-
- var _this7 = _possibleConstructorReturn(this, (ProductViewGallery.__proto__ || Object.getPrototypeOf(ProductViewGallery)).call(this, props));
-
- _this7.state = {
- loading: true,
- currentItem: 1,
- galleryWrapperMarginLeft: 0
- };
- _this7.updateDimensions = _this7.updateDimensions.bind(_this7);
- _this7.onLeftArrowClick = _this7.onLeftArrowClick.bind(_this7);
- _this7.onRightArrowClick = _this7.onRightArrowClick.bind(_this7);
- _this7.animateGallerySlider = _this7.animateGallerySlider.bind(_this7);
- return _this7;
- }
-
- _createClass(ProductViewGallery, [{
- key: 'componentDidMount',
- value: function componentDidMount() {
- window.addEventListener("resize", this.updateDimensions);
- this.updateDimensions();
- }
- }, {
- key: 'componentWillUnmount',
- value: function componentWillUnmount() {
- window.removeEventListener("resize", this.updateDimensions);
- }
- }, {
- key: 'updateDimensions',
- value: function updateDimensions() {
- var productGallery = document.getElementById('product-gallery');
- var itemsWidth = 300;
- var itemsTotal = this.props.product.r_gallery.length + 1;
- this.setState({
- itemsWidth: itemsWidth,
- itemsTotal: itemsTotal,
- loading: false
- });
- }
- }, {
- key: 'onLeftArrowClick',
- value: function onLeftArrowClick() {
- var nextItem = void 0;
- if (this.state.currentItem <= 1) {
- nextItem = this.state.itemsTotal;
- } else {
- nextItem = this.state.currentItem - 1;
- }
- var marginLeft = this.state.itemsWidth * (nextItem - 1);
- this.animateGallerySlider(nextItem, marginLeft);
- }
- }, {
- key: 'onRightArrowClick',
- value: function onRightArrowClick() {
- var nextItem = void 0;
- if (this.state.currentItem === this.state.itemsTotal) {
- nextItem = 1;
- } else {
- nextItem = this.state.currentItem + 1;
- }
- var marginLeft = this.state.itemsWidth * (nextItem - 1);
- this.animateGallerySlider(nextItem, marginLeft);
- }
- }, {
- key: 'animateGallerySlider',
- value: function animateGallerySlider(nextItem, marginLeft) {
- this.setState({ currentItem: nextItem, galleryWrapperMarginLeft: "-" + marginLeft + "px" });
- }
- }, {
- key: 'onGalleryItemClick',
- value: function onGalleryItemClick(num) {
- store.dispatch(showLightboxGallery(num));
- }
- }, {
- key: 'render',
- value: function render() {
- var _this8 = this;
-
- var galleryDisplay = void 0;
-
- if (this.props.product.embed_code && this.props.product.embed_code.length > 0) {
-
- var imageBaseUrl = void 0;
- if (store.getState().env === 'live') {
- imageBaseUrl = 'http://cn.opendesktop.org';
- } else {
- imageBaseUrl = 'http://cn.pling.it';
- }
-
- if (this.props.product.r_gallery.length > 0) {
-
- var itemsWidth = this.state.itemsWidth;
- var currentItem = this.state.currentItem;
- var self = this;
- var moreItems = this.props.product.r_gallery.map(function (gi, index) {
- return React.createElement(
- 'div',
- { key: index, onClick: function onClick() {
- return _this8.onGalleryItemClick(index + 2);
- }, className: currentItem === index + 2 ? "active-gallery-item gallery-item" : "gallery-item" },
- React.createElement('img', { className: 'media-item', src: imageBaseUrl + "/img/" + gi })
- );
- });
-
- galleryDisplay = React.createElement(
- 'div',
- { id: 'product-gallery' },
- React.createElement(
- 'a',
- { className: 'gallery-arrow arrow-left', onClick: this.onLeftArrowClick },
- React.createElement(
- 'i',
- { className: 'material-icons' },
- 'chevron_left'
- )
- ),
- React.createElement(
- 'div',
- { className: 'section' },
- React.createElement(
- 'div',
- { style: { "width": this.state.itemsWidth * this.state.itemsTotal + "px", "marginLeft": this.state.galleryWrapperMarginLeft }, className: 'gallery-items-wrapper' },
- React.createElement('div', { onClick: function onClick() {
- return _this8.onGalleryItemClick(1);
- }, dangerouslySetInnerHTML: { __html: this.props.product.embed_code }, className: this.state.currentItem === 1 ? "active-gallery-item gallery-item" : "gallery-item" }),
- moreItems
- )
- ),
- React.createElement(
- 'a',
- { className: 'gallery-arrow arrow-right', onClick: this.onRightArrowClick },
- React.createElement(
- 'i',
- { className: 'material-icons' },
- 'chevron_right'
- )
- )
- );
- }
- }
-
- return React.createElement(
- 'div',
- { className: 'section', id: 'product-view-gallery-container' },
- React.createElement(
- 'div',
- { className: 'container' },
- React.createElement(
- 'div',
- { className: 'section' },
- galleryDisplay
- )
- )
- );
- }
- }]);
-
- return ProductViewGallery;
-}(React.Component);
-
-var ProductGalleryLightbox = function (_React$Component7) {
- _inherits(ProductGalleryLightbox, _React$Component7);
-
- function ProductGalleryLightbox(props) {
- _classCallCheck(this, ProductGalleryLightbox);
-
- var _this9 = _possibleConstructorReturn(this, (ProductGalleryLightbox.__proto__ || Object.getPrototypeOf(ProductGalleryLightbox)).call(this, props));
-
- var currentItem = void 0;
- if (store.getState().lightboxGallery) {
- currentItem = store.getState().lightboxGallery.currentItem;
- } else {
- currentItem = 1;
- }
- _this9.state = {
- currentItem: currentItem,
- loading: true
- };
- _this9.updateDimensions = _this9.updateDimensions.bind(_this9);
- _this9.toggleNextGalleryItem = _this9.toggleNextGalleryItem.bind(_this9);
- _this9.togglePrevGalleryItem = _this9.togglePrevGalleryItem.bind(_this9);
- _this9.animateGallerySlider = _this9.animateGallerySlider.bind(_this9);
- _this9.onThumbnailClick = _this9.onThumbnailClick.bind(_this9);
- return _this9;
- }
-
- _createClass(ProductGalleryLightbox, [{
- key: 'componentDidMount',
- value: function componentDidMount() {
- window.addEventListener("resize", this.updateDimensions);
- this.updateDimensions();
- }
- }, {
- key: 'componentWillUnmount',
- value: function componentWillUnmount() {
- window.removeEventListener("resize", this.updateDimensions);
- }
- }, {
- key: 'updateDimensions',
- value: function updateDimensions() {
- var thumbnailsSectionWidth = document.getElementById('thumbnails-section').offsetWidth;
- var itemsWidth = 300;
- var itemsTotal = this.props.product.r_gallery.length + 1;
- var thumbnailsMarginLeft = 0;
- if (this.state.currentItem * itemsWidth > thumbnailsSectionWidth) {
- thumbnailsMarginLeft = thumbnailsSectionWidth - this.state.currentItem * itemsWidth;
- }
- this.setState({
- itemsWidth: itemsWidth,
- itemsTotal: itemsTotal,
- thumbnailsSectionWidth: thumbnailsSectionWidth,
- thumbnailsMarginLeft: thumbnailsMarginLeft,
- loading: false
- });
- }
- }, {
- key: 'togglePrevGalleryItem',
- value: function togglePrevGalleryItem() {
- var nextItem = void 0;
- if (this.state.currentItem <= 1) {
- nextItem = this.state.itemsTotal;
- } else {
- nextItem = this.state.currentItem - 1;
- }
-
- this.animateGallerySlider(nextItem);
- }
- }, {
- key: 'toggleNextGalleryItem',
- value: function toggleNextGalleryItem() {
- var nextItem = void 0;
- if (this.state.currentItem === this.state.itemsTotal) {
- nextItem = 1;
- } else {
- nextItem = this.state.currentItem + 1;
- }
- this.animateGallerySlider(nextItem);
- }
- }, {
- key: 'animateGallerySlider',
- value: function animateGallerySlider(currentItem) {
- this.setState({ currentItem: currentItem }, function () {
- this.updateDimensions();
- });
- }
- }, {
- key: 'onThumbnailClick',
- value: function onThumbnailClick(num) {
- this.animateGallerySlider(num);
- }
- }, {
- key: 'hideLightbox',
- value: function hideLightbox() {
- store.dispatch(hideLightboxGallery());
- }
- }, {
- key: 'render',
- value: function render() {
- var _this10 = this;
-
- var imageBaseUrl = void 0;
- if (store.getState().env === 'live') {
- imageBaseUrl = 'http://cn.opendesktop.org';
- } else {
- imageBaseUrl = 'http://cn.pling.it';
- }
-
- var currentItem = this.state.currentItem;
- var self = this;
- var thumbnails = this.props.product.r_gallery.map(function (gi, index) {
- return React.createElement(
- 'div',
- { key: index, onClick: function onClick() {
- return self.onThumbnailClick(index + 2);
- }, className: self.state.currentItem === index + 2 ? "active thumbnail-item" : "thumbnail-item" },
- React.createElement('img', { className: 'media-item', src: imageBaseUrl + "/img/" + gi })
- );
- });
-
- var mainItemDisplay = void 0;
- if (currentItem === 1) {
- mainItemDisplay = React.createElement('div', { dangerouslySetInnerHTML: { __html: this.props.product.embed_code } });
- } else {
- var mainItem = this.props.product.r_gallery[currentItem - 2];
- mainItemDisplay = React.createElement('img', { className: 'media-item', src: imageBaseUrl + "/img/" + mainItem });
- }
-
- return React.createElement(
- 'div',
- { id: 'product-gallery-lightbox' },
- React.createElement(
- 'a',
- { id: 'close-lightbox', onClick: this.hideLightbox },
- React.createElement(
- 'i',
- { className: 'material-icons' },
- 'cancel'
- )
- ),
- React.createElement(
- 'div',
- { id: 'lightbox-gallery-main-view' },
- React.createElement(
- 'a',
- { className: 'gallery-arrow', onClick: this.togglePrevGalleryItem, id: 'arrow-left' },
- React.createElement(
- 'i',
- { className: 'material-icons' },
- 'chevron_left'
- )
- ),
- React.createElement(
- 'div',
- { className: 'current-gallery-item' },
- mainItemDisplay
- ),
- React.createElement(
- 'a',
- { className: 'gallery-arrow', onClick: this.toggleNextGalleryItem, id: 'arrow-right' },
- React.createElement(
- 'i',
- { className: 'material-icons' },
- 'chevron_right'
- )
- )
- ),
- React.createElement(
- 'div',
- { id: 'lightbox-gallery-thumbnails' },
- React.createElement(
- 'div',
- { className: 'section', id: 'thumbnails-section' },
- React.createElement(
- 'div',
- { id: 'gallery-items-wrapper', style: { "width": this.state.itemsTotal * this.state.itemsWidth + "px", "marginLeft": this.state.thumbnailsMarginLeft + "px" } },
- React.createElement('div', { onClick: function onClick() {
- return _this10.onThumbnailClick(1);
- }, dangerouslySetInnerHTML: { __html: this.props.product.embed_code }, className: this.state.currentItem === 1 ? "active thumbnail-item" : "thumbnail-item" }),
- thumbnails
- )
- )
- )
- );
- }
- }]);
-
- return ProductGalleryLightbox;
-}(React.Component);
-
-var ProductDescription = function (_React$Component8) {
- _inherits(ProductDescription, _React$Component8);
-
- function ProductDescription(props) {
- _classCallCheck(this, ProductDescription);
-
- var _this11 = _possibleConstructorReturn(this, (ProductDescription.__proto__ || Object.getPrototypeOf(ProductDescription)).call(this, props));
-
- _this11.state = {};
- return _this11;
- }
-
- _createClass(ProductDescription, [{
- key: 'render',
- value: function render() {
- return React.createElement(
- 'div',
- { id: 'product-description', className: 'section' },
- React.createElement(
- 'div',
- { className: 'container' },
- React.createElement(
- 'div',
- { className: 'main-content' },
- React.createElement(
- 'article',
- null,
- React.createElement('p', { dangerouslySetInnerHTML: { __html: this.props.product.description } })
- ),
- React.createElement(
- 'aside',
- null,
- React.createElement(
- 'ul',
- null,
- React.createElement(
- 'li',
- null,
- React.createElement(
- 'span',
- { className: 'key' },
- 'License'
- ),
- React.createElement(
- 'span',
- { className: 'val' },
- this.props.product.project_license_title
- )
- ),
- React.createElement(
- 'li',
- null,
- React.createElement(
- 'span',
- { className: 'key' },
- 'Last Update'
- ),
- React.createElement(
- 'span',
- { className: 'val' },
- this.props.product.changed_at.split(' ')[0]
- )
- )
- )
- )
- )
- )
- );
- }
- }]);
-
- return ProductDescription;
-}(React.Component);
-
-var ProductNavBar = function (_React$Component9) {
- _inherits(ProductNavBar, _React$Component9);
-
- function ProductNavBar() {
- _classCallCheck(this, ProductNavBar);
-
- return _possibleConstructorReturn(this, (ProductNavBar.__proto__ || Object.getPrototypeOf(ProductNavBar)).apply(this, arguments));
- }
-
- _createClass(ProductNavBar, [{
- key: 'render',
- value: function render() {
- var _this13 = this;
-
- var productNavBarDisplay = void 0;
- var filesMenuItem = void 0,
- ratingsMenuItem = void 0,
- favsMenuItem = void 0,
- plingsMenuItem = void 0;
- if (this.props.product.r_files.length > 0) {
- filesMenuItem = React.createElement(
- 'a',
- { className: this.props.tab === "files" ? "item active" : "item", onClick: function onClick() {
- return _this13.props.onTabToggle('files');
- } },
- 'Files (',
- this.props.product.r_files.length,
- ')'
- );
- }
- if (this.props.product.r_ratings.length > 0) {
- var activeRatingsNumber = productHelpers.getActiveRatingsNumber(this.props.product.r_ratings);
- ratingsMenuItem = React.createElement(
- 'a',
- { className: this.props.tab === "ratings" ? "item active" : "item", onClick: function onClick() {
- return _this13.props.onTabToggle('ratings');
- } },
- 'Ratings & Reviews (',
- activeRatingsNumber,
- ')'
- );
- }
- if (this.props.product.r_likes.length > 0) {
- favsMenuItem = React.createElement(
- 'a',
- { className: this.props.tab === "favs" ? "item active" : "item", onClick: function onClick() {
- return _this13.props.onTabToggle('favs');
- } },
- 'Favs (',
- this.props.product.r_likes.length,
- ')'
- );
- }
- if (this.props.product.r_plings.length > 0) {
- plingsMenuItem = React.createElement(
- 'a',
- { className: this.props.tab === "plings" ? "item active" : "item", onClick: function onClick() {
- return _this13.props.onTabToggle('plings');
- } },
- 'Plings (',
- this.props.product.r_plings.length,
- ')'
- );
- }
- return React.createElement(
- 'div',
- { className: 'wrapper' },
- React.createElement(
- 'div',
- { className: 'container' },
- React.createElement(
- 'div',
- { className: 'explore-top-bar' },
- React.createElement(
- 'a',
- { className: this.props.tab === "comments" ? "item active" : "item", onClick: function onClick() {
- return _this13.props.onTabToggle('comments');
- } },
- 'Comments (',
- this.props.product.r_comments.length,
- ')'
- ),
- filesMenuItem,
- ratingsMenuItem,
- favsMenuItem,
- plingsMenuItem
- )
- )
- );
- }
- }]);
-
- return ProductNavBar;
-}(React.Component);
-
-var ProductViewContent = function (_React$Component10) {
- _inherits(ProductViewContent, _React$Component10);
-
- function ProductViewContent() {
- _classCallCheck(this, ProductViewContent);
-
- return _possibleConstructorReturn(this, (ProductViewContent.__proto__ || Object.getPrototypeOf(ProductViewContent)).apply(this, arguments));
- }
-
- _createClass(ProductViewContent, [{
- key: 'render',
- value: function render() {
-
- var currentTabDisplay = void 0;
- if (this.props.tab === 'comments') {
- currentTabDisplay = React.createElement(
- 'div',
- { className: 'product-tab', id: 'comments-tab' },
- React.createElement(ProductCommentsContainer, {
- product: this.props.product,
- user: this.props.user
- })
- );
- } else if (this.props.tab === 'files') {
- currentTabDisplay = React.createElement(ProductViewFilesTab, {
- product: this.props.product,
- files: this.props.product.r_files
- });
- } else if (this.props.tab === 'ratings') {
- currentTabDisplay = React.createElement(ProductViewRatingsTabWrapper, {
- ratings: this.props.product.r_ratings
- });
- } else if (this.props.tab === 'favs') {
- currentTabDisplay = React.createElement(ProductViewFavTab, {
- likes: this.props.product.r_likes
- });
- } else if (this.props.tab === 'plings') {
- currentTabDisplay = React.createElement(ProductViewPlingsTab, {
- plings: this.props.product.r_plings
- });
- }
- return React.createElement(
- 'div',
- { className: 'wrapper' },
- React.createElement(
- 'div',
- { className: 'container' },
- React.createElement(
- 'div',
- { className: 'section', id: 'product-view-content-container' },
- currentTabDisplay
- )
- )
- );
- }
- }]);
-
- return ProductViewContent;
-}(React.Component);
-
-var ProductCommentsContainer = function (_React$Component11) {
- _inherits(ProductCommentsContainer, _React$Component11);
-
- function ProductCommentsContainer(props) {
- _classCallCheck(this, ProductCommentsContainer);
-
- var _this15 = _possibleConstructorReturn(this, (ProductCommentsContainer.__proto__ || Object.getPrototypeOf(ProductCommentsContainer)).call(this, props));
-
- _this15.state = {};
- return _this15;
- }
-
- _createClass(ProductCommentsContainer, [{
- key: 'render',
- value: function render() {
- var _this16 = this;
-
- var commentsDisplay = void 0;
- var cArray = categoryHelpers.convertCatChildrenObjectToArray(this.props.product.r_comments);
- if (cArray.length > 0) {
- var product = this.props.product;
- var comments = cArray.map(function (c, index) {
- if (c.level === 1) {
- return React.createElement(CommentItem, { user: _this16.props.user, product: product, comment: c.comment, key: index, level: 1 });
- }
- });
- commentsDisplay = React.createElement(
- 'div',
- { className: 'comment-list' },
- comments
- );
- }
-
- return React.createElement(
- 'div',
- { className: 'product-view-section', id: 'product-comments-container' },
- React.createElement(CommentForm, {
- user: this.props.user,
- product: this.props.product
- }),
- commentsDisplay
- );
- }
- }]);
-
- return ProductCommentsContainer;
-}(React.Component);
-
-var CommentForm = function (_React$Component12) {
- _inherits(CommentForm, _React$Component12);
-
- function CommentForm(props) {
- _classCallCheck(this, CommentForm);
-
- var _this17 = _possibleConstructorReturn(this, (CommentForm.__proto__ || Object.getPrototypeOf(CommentForm)).call(this, props));
-
- _this17.state = {
- text: '',
- errorMsg: '',
- errorTitle: '',
- loading: false
- };
- _this17.updateCommentText = _this17.updateCommentText.bind(_this17);
- _this17.submitComment = _this17.submitComment.bind(_this17);
- _this17.updateComments = _this17.updateComments.bind(_this17);
- return _this17;
- }
-
- _createClass(CommentForm, [{
- key: 'updateCommentText',
- value: function updateCommentText(e) {
- this.setState({ text: e.target.value });
- }
- }, {
- key: 'submitComment',
- value: function submitComment() {
- this.setState({ loading: true }, function () {
- var msg = this.state.text;
- var self = this;
- var data = {
- p: this.props.product.project_id,
- m: this.props.user.member_id,
- msg: this.state.text
- };
- if (this.props.comment) {
- data.i = this.props.comment.comment_id;
- }
- jQuery.ajax({
- data: data,
- url: '/productcomment/addreply/',
- type: 'post',
- dataType: 'json',
- error: function error(jqXHR, textStatus, errorThrown) {
- var results = JSON && JSON.parse(jqXHR.responseText) || $.parseJSON(jqXHR.responseText);
- self.setState({
- errorMsg: results.message,
- errorTitle: results.title,
- login_url: results.login_url,
- status: 'error' });
- },
- success: function success(results) {
- var baseUrl = void 0;
- if (store.getState().env === 'live') {
- baseUrl = 'cn.opendesktop.org';
- } else {
- baseUrl = 'cn.pling.it';
- }
- $.ajax({ url: '/productcomment?p=' + self.props.product.project_id, cache: false }).done(function (response) {
- self.updateComments(response);
- });
- }
- });
- });
- }
- }, {
- key: 'updateComments',
- value: function updateComments(response) {
- store.dispatch(setProductComments(response));
- this.setState({ text: '', loading: false }, function () {
- if (this.props.hideReplyForm) {
- this.props.hideReplyForm();
- }
- });
- }
- }, {
- key: 'render',
- value: function render() {
-
- var commentFormDisplay = void 0;
- if (this.props.user.username) {
- if (this.state.loading) {
- commentFormDisplay = React.createElement(
- 'div',
- { className: 'comment-form-container' },
- React.createElement(
- 'p',
- null,
- React.createElement('span', { className: 'glyphicon glyphicon-refresh spinning' }),
- ' posting comment'
- )
- );
- } else {
- var submitBtnDisplay = void 0;
- if (this.state.text.length === 0) {
- submitBtnDisplay = React.createElement(
- 'button',
- { disabled: 'disabled', type: 'button', className: 'mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored mdl-color--primary' },
- 'send'
- );
- } else {
- submitBtnDisplay = React.createElement(
- 'button',
- { onClick: this.submitComment, type: 'button', className: 'mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored mdl-color--primary' },
- React.createElement('span', { className: 'glyphicon glyphicon-send' }),
- 'send'
- );
- }
-
- var errorDisplay = void 0;
- if (this.state.status === 'error') {
- errorDisplay = React.createElement(
- 'div',
- { className: 'comment-form-error-display-container' },
- React.createElement('div', { dangerouslySetInnerHTML: { __html: this.state.errorTitle } }),
- React.createElement('div', { dangerouslySetInnerHTML: { __html: this.state.errorMsg } })
- );
- }
-
- commentFormDisplay = React.createElement(
- 'div',
- { className: 'comment-form-container' },
- React.createElement(
- 'span',
- null,
- 'Add Comment'
- ),
- React.createElement('textarea', { className: 'form-control', onChange: this.updateCommentText, value: this.state.text }),
- errorDisplay,
- submitBtnDisplay
- );
- }
- } else {
- commentFormDisplay = React.createElement(
- 'p',
- null,
- 'Please ',
- React.createElement(
- 'a',
- { href: '/login?redirect=ohWn43n4SbmJZWlKUZNl2i1_s5gggiCE' },
- 'login'
- ),
- ' or ',
- React.createElement(
- 'a',
- { href: '/register' },
- 'register'
- ),
- ' to add a comment'
- );
- }
-
- return React.createElement(
- 'div',
- { id: 'product-page-comment-form-container' },
- commentFormDisplay
- );
- }
- }]);
-
- return CommentForm;
-}(React.Component);
-
-var CommentItem = function (_React$Component13) {
- _inherits(CommentItem, _React$Component13);
-
- function CommentItem(props) {
- _classCallCheck(this, CommentItem);
-
- var _this18 = _possibleConstructorReturn(this, (CommentItem.__proto__ || Object.getPrototypeOf(CommentItem)).call(this, props));
-
- _this18.state = {
- showCommentReplyForm: false
- };
- _this18.filterByCommentLevel = _this18.filterByCommentLevel.bind(_this18);
- _this18.onToggleReplyForm = _this18.onToggleReplyForm.bind(_this18);
- _this18.onReportComment = _this18.onReportComment.bind(_this18);
- _this18.onConfirmReportClick = _this18.onConfirmReportClick.bind(_this18);
- return _this18;
- }
-
- _createClass(CommentItem, [{
- key: 'filterByCommentLevel',
- value: function filterByCommentLevel(val) {
- if (val.level > this.props.level && this.props.comment.comment_id === val.comment.comment_parent_id) {
- return val;
- }
- }
- }, {
- key: 'onToggleReplyForm',
- value: function onToggleReplyForm() {
- var showCommentReplyForm = this.state.showCommentReplyForm === true ? false : true;
- this.setState({ showCommentReplyForm: showCommentReplyForm });
- }
- }, {
- key: 'onReportComment',
- value: function onReportComment() {
- $('#report-' + this.props.comment.comment_id).modal('show');
- }
- }, {
- key: 'onConfirmReportClick',
- value: function onConfirmReportClick(commentId, productId) {
- jQuery.ajax({
- data: {
- i: commentId,
- p: productId
- },
- url: "/report/comment/",
- type: "POST",
- dataType: "json",
- error: function error(jqXHR, textStatus, errorThrown) {
- var results = JSON && JSON.parse(jqXHR.responseText) || $.parseJSON(jqXHR.responseText);
- $("#report-" + commentId).find('.modal-header-text').empty().append(results.title);
- $("#report-" + commentId).find('.modal-body').empty().append(results.message);
- setTimeout(function () {
- $("#report-" + commentId).modal('hide');
- }, 2000);
- },
- success: function success(results) {
- if (results.status == 'ok') {
- $("#report-" + commentId).find(".comment-report-p").empty().html(results.message.split('')[0].split('')[1]);
- }
- if (results.status == 'error') {
- if (results.message != '') {
- $("#report-" + commentId).find(".comment-report-p").empty().html(results.message);
- } else {
- $("#report-" + commentId).find(".comment-report-p").empty().html('Service is temporarily unavailable.');
- }
- }
- setTimeout(function () {
- $("#report-" + commentId).modal('hide');
- }, 2000);
- }
- });
- }
- }, {
- key: 'render',
- value: function render() {
- var commentRepliesContainer = void 0;
- var filteredComments = categoryHelpers.convertCatChildrenObjectToArray(this.props.product.r_comments).filter(this.filterByCommentLevel);
- if (filteredComments.length > 0) {
- var product = this.props.product;
- var user = this.props.user;
- var comments = filteredComments.map(function (c, index) {
- return React.createElement(CommentItem, { user: user, product: product, comment: c.comment, key: index, level: c.level });
- });
- commentRepliesContainer = React.createElement(
- 'div',
- { className: 'comment-item-replies-container' },
- comments
- );
- }
-
- var displayIsSupporter = void 0;
- if (this.props.comment.issupporter === "1") {
- displayIsSupporter = React.createElement(
- 'li',
- null,
- React.createElement(
- 'span',
- { className: 'is-supporter-display uc-icon' },
- 'S'
- )
- );
- }
-
- var displayIsCreater = void 0;
- if (this.props.comment.member_id === this.props.product.member_id) {
- displayIsCreater = React.createElement(
- 'li',
- null,
- React.createElement(
- 'span',
- { className: 'is-creater-display uc-icon' },
- 'C'
- )
- );
- }
-
- var commentReplyFormDisplay = void 0;
- if (this.state.showCommentReplyForm) {
- commentReplyFormDisplay = React.createElement(CommentForm, {
- comment: this.props.comment,
- user: this.props.user,
- product: this.props.product,
- hideReplyForm: this.onToggleReplyForm
- });
- }
-
- return React.createElement(
- 'div',
- { className: 'comment-item' },
- React.createElement(
- 'div',
- { className: 'comment-user-avatar' },
- React.createElement('img', { src: this.props.comment.profile_image_url })
- ),
- React.createElement(
- 'div',
- { className: 'comment-item-content' },
- React.createElement(
- 'div',
- { className: 'comment-item-header' },
- React.createElement(
- 'ul',
- null,
- React.createElement(
- 'li',
- null,
- React.createElement(
- 'a',
- { className: 'comment-username', href: "/member/" + this.props.comment.member_id },
- this.props.comment.username
- )
- ),
- displayIsSupporter,
- displayIsCreater,
- React.createElement(
- 'li',
- null,
- React.createElement(
- 'span',
- { className: 'comment-created-at' },
- appHelpers.getTimeAgo(this.props.comment.comment_created_at)
- )
- )
- )
- ),
- React.createElement(
- 'div',
- { className: 'comment-item-text' },
- this.props.comment.comment_text
- ),
- React.createElement(
- 'div',
- { className: 'comment-item-actions' },
- React.createElement(
- 'a',
- { onClick: this.onToggleReplyForm },
- React.createElement(
- 'i',
- { className: 'material-icons reverse' },
- 'reply'
- ),
- React.createElement(
- 'span',
- null,
- 'Reply'
- )
- ),
- React.createElement(
- 'a',
- { onClick: this.onReportComment },
- React.createElement(
- 'i',
- { className: 'material-icons' },
- 'warning'
- ),
- React.createElement(
- 'span',
- null,
- 'Report'
- )
- ),
- React.createElement(ReportCommentModal, {
- comment: this.props.comment,
- product: this.props.product,
- user: this.props.user,
- onConfirmReportClick: this.onConfirmReportClick
- })
- )
- ),
- commentReplyFormDisplay,
- commentRepliesContainer
- );
- }
- }]);
-
- return CommentItem;
-}(React.Component);
-
-var ReportCommentModal = function (_React$Component14) {
- _inherits(ReportCommentModal, _React$Component14);
-
- function ReportCommentModal(props) {
- _classCallCheck(this, ReportCommentModal);
-
- var _this19 = _possibleConstructorReturn(this, (ReportCommentModal.__proto__ || Object.getPrototypeOf(ReportCommentModal)).call(this, props));
-
- _this19.state = {
- status: "ready"
- };
- return _this19;
- }
-
- _createClass(ReportCommentModal, [{
- key: 'onConfirmReportClick',
- value: function onConfirmReportClick(commmentId, productId) {
- this.setState({ status: "loading" }, function () {
- this.props.onConfirmReportClick(commmentId, productId);
- });
- }
- }, {
- key: 'render',
- value: function render() {
- var _this20 = this;
-
- var confirmActionButtonIconDisplay = void 0;
- if (this.state.status === "ready") {
- confirmActionButtonIconDisplay = React.createElement(
- 'i',
- { className: 'material-icons reverse' },
- 'reply'
- );
- } else if (this.state.status === "loading") {
- confirmActionButtonIconDisplay = React.createElement('span', { className: 'glyphicon glyphicon-refresh spinning' });
- }
-
- return React.createElement(
- 'div',
- { className: 'modal report-comment-modal', id: "report-" + this.props.comment.comment_id, tabIndex: '-1', role: 'dialog' },
- React.createElement(
- 'div',
- { className: 'modal-dialog', role: 'document' },
- React.createElement(
- 'div',
- { className: 'modal-content' },
- React.createElement(
- 'div',
- { className: 'modal-header' },
- React.createElement(
- 'h4',
- { className: 'modal-title' },
- 'Report Comment'
- ),
- React.createElement(
- 'button',
- { type: 'button', id: 'review-modal-close', className: 'close', 'data-dismiss': 'modal', 'aria-label': 'Close' },
- React.createElement(
- 'span',
- { 'aria-hidden': 'true' },
- '\xD7'
- )
- )
- ),
- React.createElement(
- 'div',
- { className: 'modal-body' },
- React.createElement(
- 'p',
- { className: 'comment-report-p' },
- 'Do you really want to report this comment?'
- )
- ),
- React.createElement(
- 'div',
- { className: 'modal-footer' },
- React.createElement(
- 'a',
- { onClick: function onClick() {
- return _this20.onConfirmReportClick(_this20.props.comment.comment_id, _this20.props.product.project_id);
- } },
- confirmActionButtonIconDisplay,
- ' yes'
- )
- )
- )
- )
- );
- }
- }]);
-
- return ReportCommentModal;
-}(React.Component);
-
-var ProductViewFilesTab = function (_React$Component15) {
- _inherits(ProductViewFilesTab, _React$Component15);
-
- function ProductViewFilesTab() {
- _classCallCheck(this, ProductViewFilesTab);
-
- return _possibleConstructorReturn(this, (ProductViewFilesTab.__proto__ || Object.getPrototypeOf(ProductViewFilesTab)).apply(this, arguments));
- }
-
- _createClass(ProductViewFilesTab, [{
- key: 'render',
- value: function render() {
- var _this22 = this;
-
- var filesDisplay = void 0;
- var files = this.props.files.map(function (f, index) {
- return React.createElement(ProductViewFilesTabItem, {
- product: _this22.props.product,
- key: index,
- file: f
- });
- });
- var summeryRow = productHelpers.getFilesSummary(this.props.files);
- filesDisplay = React.createElement(
- 'tbody',
- null,
- files,
- React.createElement(
- 'tr',
- null,
- React.createElement(
- 'td',
- null,
- summeryRow.total,
- ' files (0 archived)'
- ),
- React.createElement('td', null),
- React.createElement('td', null),
- React.createElement('td', null),
- React.createElement('td', null),
- React.createElement(
- 'td',
- null,
- summeryRow.downloads
- ),
- React.createElement('td', null),
- React.createElement(
- 'td',
- null,
- appHelpers.getFileSize(summeryRow.fileSize)
- ),
- React.createElement('td', null),
- React.createElement('td', null)
- )
- );
- return React.createElement(
- 'div',
- { id: 'files-tab', className: 'product-tab' },
- React.createElement(
- 'table',
- { className: 'mdl-data-table mdl-js-data-table mdl-shadow--2dp' },
- React.createElement(
- 'thead',
- null,
- React.createElement(
- 'tr',
- null,
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'File'
- ),
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'Version'
- ),
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'Description'
- ),
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'Packagetype'
- ),
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'Architecture'
- ),
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'Downloads'
- ),
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'Date'
- ),
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'Filesize'
- ),
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'DL'
- ),
- React.createElement(
- 'th',
- { className: 'mdl-data-table__cell--non-numericm' },
- 'OCS-Install'
- )
- )
- ),
- filesDisplay
- )
- );
- }
- }]);
-
- return ProductViewFilesTab;
-}(React.Component);
-
-var ProductViewFilesTabItem = function (_React$Component16) {
- _inherits(ProductViewFilesTabItem, _React$Component16);
-
- function ProductViewFilesTabItem(props) {
- _classCallCheck(this, ProductViewFilesTabItem);
-
- var _this23 = _possibleConstructorReturn(this, (ProductViewFilesTabItem.__proto__ || Object.getPrototypeOf(ProductViewFilesTabItem)).call(this, props));
-
- _this23.state = { downloadLink: "" };
- return _this23;
- }
-
- _createClass(ProductViewFilesTabItem, [{
- key: 'componentDidMount',
- value: function componentDidMount() {
- var baseUrl = void 0,
- downloadLinkUrlAttr = void 0;
- if (store.getState().env === 'live') {
- baseUrl = 'opendesktop.org';
- downloadLinkUrlAttr = "https%3A%2F%dl.opendesktop.org%2Fapi%2F";
- } else {
- baseUrl = 'pling.cc';
- downloadLinkUrlAttr = "https%3A%2F%2Fcc.ppload.com%2Fapi%2F";
- }
-
- var f = this.props.file;
- var timestamp = Math.floor(new Date().getTime() / 1000 + 3600);
- var fileDownloadHash = appHelpers.generateFileDownloadHash(f, store.getState().env);
- var downloadLink = "https://" + baseUrl + "/p/" + this.props.product.project_id + "/startdownload?file_id=" + f.id + "&file_name=" + f.title + "&file_type=" + f.type + "&file_size=" + f.size + "&url=" + downloadLinkUrlAttr + "files%2Fdownload%2Fid%2F" + f.id + "%2Fs%2F" + fileDownloadHash + "%2Ft%2F" + timestamp + "%2Fu%2F" + this.props.product.member_id + "%2F" + f.title;
-
- this.setState({ downloadLink: downloadLink });
- }
- }, {
- key: 'render',
- value: function render() {
- var f = this.props.file;
- return React.createElement(
- 'tr',
- null,
- React.createElement(
- 'td',
- { className: 'mdl-data-table__cell--non-numericm' },
- React.createElement(
- 'a',
- { href: this.state.downloadLink },
- f.title
- )
- ),
- React.createElement(
- 'td',
- null,
- f.version
- ),
- React.createElement(
- 'td',
- { className: 'mdl-data-table__cell--non-numericm' },
- f.description
- ),
- React.createElement(
- 'td',
- { className: 'mdl-data-table__cell--non-numericm' },
- f.packagename
- ),
- React.createElement(
- 'td',
- { className: 'mdl-data-table__cell--non-numericm' },
- f.archname
- ),
- React.createElement(
- 'td',
- null,
- f.downloaded_count
- ),
- React.createElement(
- 'td',
- { className: 'mdl-data-table__cell--non-numericm' },
- appHelpers.getTimeAgo(f.created_timestamp)
- ),
- React.createElement(
- 'td',
- { className: 'mdl-data-table__cell--non-numericm' },
- appHelpers.getFileSize(f.size)
- ),
- React.createElement(
- 'td',
- null,
- React.createElement(
- 'a',
- { href: this.state.downloadLink },
- React.createElement(
- 'i',
- { className: 'material-icons' },
- 'cloud_download'
- )
- )
- ),
- React.createElement(
- 'td',
- null,
- f.ocs_compatible
- )
- );
- }
- }]);
-
- return ProductViewFilesTabItem;
-}(React.Component);
-
-var ProductViewRatingsTab = function (_React$Component17) {
- _inherits(ProductViewRatingsTab, _React$Component17);
-
- function ProductViewRatingsTab(props) {
- _classCallCheck(this, ProductViewRatingsTab);
-
- var _this24 = _possibleConstructorReturn(this, (ProductViewRatingsTab.__proto__ || Object.getPrototypeOf(ProductViewRatingsTab)).call(this, props));
-
- _this24.state = {
- filter: 'active'
- };
- _this24.filterLikes = _this24.filterLikes.bind(_this24);
- _this24.filterDislikes = _this24.filterDislikes.bind(_this24);
- _this24.filterActive = _this24.filterActive.bind(_this24);
- _this24.setFilter = _this24.setFilter.bind(_this24);
- return _this24;
- }
-
- _createClass(ProductViewRatingsTab, [{
- key: 'filterLikes',
- value: function filterLikes(rating) {
- if (rating.user_like === "1") {
- return rating;
- }
- }
- }, {
- key: 'filterDislikes',
- value: function filterDislikes(rating) {
- if (rating.user_dislike === "1") {
- return rating;
- }
- }
- }, {
- key: 'filterActive',
- value: function filterActive(rating) {
- if (rating.rating_active === "1") {
- return rating;
- }
- }
- }, {
- key: 'setFilter',
- value: function setFilter(filter) {
- this.setState({ filter: filter });
- }
- }, {
- key: 'render',
- value: function render() {
- var _this25 = this;
-
- var ratingsLikes = this.props.ratings.filter(this.filterLikes);
- var ratingsDislikes = this.props.ratings.filter(this.filterDislikes);
- var ratingsActive = this.props.ratings.filter(this.filterActive);
-
- var ratingsDisplay = void 0;
- if (this.props.ratings.length > 0) {
-
- var ratings = void 0;
- if (this.state.filter === "all") {
- ratings = this.props.ratings;
- } else if (this.state.filter === "active") {
- ratings = ratingsActive;
- } else if (this.state.filter === "dislikes") {
- ratings = ratingsDislikes;
- } else if (this.state.filter === "likes") {
- ratings = ratingsLikes;
- }
-
- var ratingsItems = ratings.map(function (r, index) {
- return React.createElement(RatingItem, {
- key: index,
- rating: r
- });
- });
-
- ratingsDisplay = React.createElement(
- 'div',
- { className: 'product-ratings-list comment-list' },
- ratingsItems
- );
- }
- var subMenuItemClassName = " mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect";
- var subMenuActiveItemClassName = "active mdl-button--colored mdl-color--primary item";
- return React.createElement(
- 'div',
- { id: 'ratings-tab', className: 'product-tab' },
- React.createElement(
- 'div',
- { className: 'ratings-filters-menu' },
- React.createElement(
- 'span',
- { className: 'btn-container', onClick: function onClick() {
- return _this25.setFilter("dislikes");
- } },
- React.createElement(
- 'a',
- { className: this.state.filter === "dislikes" ? subMenuActiveItemClassName + subMenuItemClassName : subMenuItemClassName, onClick: this.showDislikes },
- 'show dislikes (',
- ratingsDislikes.length,
- ')'
- )
- ),
- React.createElement(
- 'span',
- { className: 'btn-container', onClick: function onClick() {
- return _this25.setFilter("likes");
- } },
- React.createElement(
- 'a',
- _defineProperty({ onClick: this.setDislikesFilter, className: this.state.filter === "likes" ? subMenuActiveItemClassName + subMenuItemClassName : subMenuItemClassName }, 'onClick', this.showLikes),
- 'show likes (',
- ratingsLikes.length,
- ')'
- )
- ),
- React.createElement(
- 'span',
- { className: 'btn-container', onClick: function onClick() {
- return _this25.setFilter("active");
- } },
- React.createElement(
- 'a',
- _defineProperty({ onClick: this.setDislikesFilter, className: this.state.filter === "active" ? subMenuActiveItemClassName + subMenuItemClassName : subMenuItemClassName }, 'onClick', this.showActive),
- 'show active reviews (',
- ratingsActive.length,
- ')'
- )
- ),
- React.createElement(
- 'span',
- { className: 'btn-container', onClick: function onClick() {
- return _this25.setFilter("all");
- } },
- React.createElement(
- 'a',
- _defineProperty({ onClick: this.setDislikesFilter, className: this.state.filter === "all" ? subMenuActiveItemClassName + subMenuItemClassName : subMenuItemClassName }, 'onClick', this.showAll),
- 'show all (',
- this.props.ratings.length,
- ')'
- )
- )
- ),
- ratingsDisplay
- );
- }
- }]);
-
- return ProductViewRatingsTab;
-}(React.Component);
-
-var mapStateToProductViewRatingsTabProps = function mapStateToProductViewRatingsTabProps(state) {
- var ratings = state.product.r_ratings;
- return {
- ratings: ratings
- };
-};
-
-var mapDispatchToProductViewRatingsTabProps = function mapDispatchToProductViewRatingsTabProps(dispatch) {
- return {
- dispatch: dispatch
- };
-};
-
-var ProductViewRatingsTabWrapper = ReactRedux.connect(mapStateToProductViewRatingsTabProps, mapDispatchToProductViewRatingsTabProps)(ProductViewRatingsTab);
-
-var RatingItem = function (_React$Component18) {
- _inherits(RatingItem, _React$Component18);
-
- function RatingItem(props) {
- _classCallCheck(this, RatingItem);
-
- var _this26 = _possibleConstructorReturn(this, (RatingItem.__proto__ || Object.getPrototypeOf(RatingItem)).call(this, props));
-
- _this26.state = {};
- return _this26;
- }
-
- _createClass(RatingItem, [{
- key: 'render',
- value: function render() {
- return React.createElement(
- 'div',
- { className: 'product-rating-item comment-item' },
- React.createElement(
- 'div',
- { className: 'rating-user-avatar comment-user-avatar' },
- React.createElement('img', { src: this.props.rating.profile_image_url })
- ),
- React.createElement(
- 'div',
- { className: 'rating-item-content comment-item-content' },
- React.createElement(
- 'div',
- { className: 'rating-item-header comment-item-header' },
- React.createElement(
- 'a',
- { href: "/member/" + this.props.rating.member_id },
- this.props.rating.username
- ),
- React.createElement(
- 'span',
- { className: 'comment-created-at' },
- appHelpers.getTimeAgo(this.props.rating.created_at)
- )
- ),
- React.createElement(
- 'div',
- { className: 'rating-item-text comment-item-text' },
- this.props.rating.comment_text
- )
- )
- );
- }
- }]);
-
- return RatingItem;
-}(React.Component);
-
-var ProductViewFavTab = function (_React$Component19) {
- _inherits(ProductViewFavTab, _React$Component19);
-
- function ProductViewFavTab(props) {
- _classCallCheck(this, ProductViewFavTab);
-
- var _this27 = _possibleConstructorReturn(this, (ProductViewFavTab.__proto__ || Object.getPrototypeOf(ProductViewFavTab)).call(this, props));
-
- _this27.state = {};
- return _this27;
- }
-
- _createClass(ProductViewFavTab, [{
- key: 'render',
- value: function render() {
- var favsDisplay = void 0;
- if (this.props.likes) {
- var favs = this.props.likes.map(function (like, index) {
- return React.createElement(UserCardItem, {
- key: index,
- like: like
- });
- });
- favsDisplay = React.createElement(
- 'div',
- { className: 'favs-list supporter-list' },
- favs
- );
- }
- return React.createElement(
- 'div',
- { className: 'product-tab', id: 'fav-tab' },
- favsDisplay
- );
- }
- }]);
-
- return ProductViewFavTab;
-}(React.Component);
-
-var ProductViewPlingsTab = function (_React$Component20) {
- _inherits(ProductViewPlingsTab, _React$Component20);
-
- function ProductViewPlingsTab(props) {
- _classCallCheck(this, ProductViewPlingsTab);
-
- var _this28 = _possibleConstructorReturn(this, (ProductViewPlingsTab.__proto__ || Object.getPrototypeOf(ProductViewPlingsTab)).call(this, props));
-
- _this28.state = {};
- return _this28;
- }
-
- _createClass(ProductViewPlingsTab, [{
- key: 'render',
- value: function render() {
- var plingsDisplay = void 0;
- if (this.props.plings) {
- var plings = this.props.plings.map(function (pling, index) {
- return React.createElement(UserCardItem, {
- key: index,
- pling: pling
- });
- });
- plingsDisplay = React.createElement(
- 'div',
- { className: 'plings-list supporter-list' },
- plings
- );
- }
- return React.createElement(
- 'div',
- { className: 'product-tab', id: 'plings-tab' },
- plingsDisplay
- );
- }
- }]);
-
- return ProductViewPlingsTab;
-}(React.Component);
-
-var UserCardItem = function (_React$Component21) {
- _inherits(UserCardItem, _React$Component21);
-
- function UserCardItem(props) {
- _classCallCheck(this, UserCardItem);
-
- var _this29 = _possibleConstructorReturn(this, (UserCardItem.__proto__ || Object.getPrototypeOf(UserCardItem)).call(this, props));
-
- _this29.state = {};
- return _this29;
- }
-
- _createClass(UserCardItem, [{
- key: 'render',
- value: function render() {
- var item = void 0;
- if (this.props.like) {
- item = this.props.like;
- } else if (this.props.pling) {
- item = this.props.pling;
- }
-
- var cardTypeDisplay = void 0;
- if (this.props.like) {
- cardTypeDisplay = React.createElement('i', { className: 'fa fa-heart myfav', 'aria-hidden': 'true' });
- } else if (this.props.pling) {
- cardTypeDisplay = React.createElement('img', { src: '/images/system/pling-btn-active.png' });
- }
-
- return React.createElement(
- 'div',
- { className: 'supporter-list-item' },
- React.createElement(
- 'div',
- { className: 'item-content' },
- React.createElement(
- 'div',
- { className: 'user-avatar' },
- React.createElement('img', { src: item.profile_image_url })
- ),
- React.createElement(
- 'span',
- { className: 'username' },
- React.createElement(
- 'a',
- { href: "/member/" + item.member_id },
- item.username
- )
- ),
- React.createElement(
- 'span',
- { className: 'card-type-holder' },
- cardTypeDisplay
- ),
- React.createElement(
- 'span',
- { className: 'created-at' },
- appHelpers.getTimeAgo(item.created_at)
- )
- )
- );
- }
- }]);
-
- return UserCardItem;
-}(React.Component);
-"use strict";
-
-var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
-
-function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
-
-function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
-
-function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
-
-var _ReactRedux = ReactRedux,
- Provider = _ReactRedux.Provider,
- connect = _ReactRedux.connect;
-
-var store = Redux.createStore(reducer);
-
-var App = function (_React$Component) {
- _inherits(App, _React$Component);
-
- function App(props) {
- _classCallCheck(this, App);
-
- var _this = _possibleConstructorReturn(this, (App.__proto__ || Object.getPrototypeOf(App)).call(this, props));
-
- _this.state = {
- loading: true,
- version: 1
- };
- _this.updateDimensions = _this.updateDimensions.bind(_this);
- return _this;
- }
-
- _createClass(App, [{
- key: "componentWillMount",
- value: function componentWillMount() {
- // device
- this.updateDimensions();
- }
- }, {
- key: "componentDidMount",
- value: function componentDidMount() {
-
- // domain
- store.dispatch(setDomain(window.location.hostname));
-
- // env
- var env = appHelpers.getEnv(window.location.hostname);
- store.dispatch(setEnv(env));
-
- // device
- window.addEventListener("resize", this.updateDimensions);
-
- // view
- if (window.view) store.dispatch(setView(view));
-
- // products
- if (window.products) {
- store.dispatch(setProducts(products));
- }
-
- // product (single)
- if (window.product) {
- store.dispatch(setProduct(product));
- store.dispatch(setProductFiles(filesJson));
- store.dispatch(setProductUpdates(updatesJson));
- store.dispatch(setProductRatings(ratingsJson));
- store.dispatch(setProductLikes(likeJson));
- store.dispatch(setProductPlings(projectplingsJson));
- store.dispatch(setProductUserRatings(ratingOfUserJson));
- store.dispatch(setProductGallery(galleryPicturesJson));
- store.dispatch(setProductComments(commentsJson));
- store.dispatch(setProductOrigins(originsJson));
- store.dispatch(setProductRelated(relatedJson));
- store.dispatch(setProductMoreProducts(moreProductsJson));
- store.dispatch(setProductMoreProductsOtherUsers(moreProductsOfOtherUsrJson));
- store.dispatch(setProductTags(tagsuserJson, tagssystemJson));
- }
-
- // pagination
- if (window.pagination) {
- store.dispatch(setPagination(pagination));
- }
-
- // filters
- if (window.filters) {
- store.dispatch(setFilters(filters));
- }
-
- // top products
- if (window.topProducts) {
- store.dispatch(setTopProducts(topProducts));
- }
-
- // categories
- if (window.categories) {
- // set categories
- store.dispatch(setCategories(categories));
- if (window.catId) {
- // current categories
- var currentCategories = categoryHelpers.findCurrentCategories(categories, catId);
- store.dispatch(setCurrentCategory(currentCategories.category));
- store.dispatch(setCurrentSubCategory(currentCategories.subcategory));
- store.dispatch(setCurrentSecondSubCategory(currentCategories.secondSubCategory));
- }
- }
-
- // supporters
- if (window.supporters) {
- store.dispatch(setSupporters(supporters));
- }
-
- // comments
- if (window.comments) {
- store.dispatch(setComments(comments));
- }
-
- // user
- if (window.user) {
- store.dispatch(setUser(user));
- }
-
- // finish loading
- this.setState({ loading: false });
- }
- }, {
- key: "componentWillUnmount",
- value: function componentWillUnmount() {
- // device
- window.removeEventListener("resize", this.updateDimensions);
- }
- }, {
- key: "updateDimensions",
- value: function updateDimensions() {
- var device = appHelpers.getDeviceWidth(window.innerWidth);
- store.dispatch(setDevice(device));
- }
- }, {
- key: "render",
- value: function render() {
- var displayView = React.createElement(HomePageWrapper, null);
- if (store.getState().view === 'explore') {
- displayView = React.createElement(ExplorePageWrapper, null);
- } else if (store.getState().view === 'product') {
- displayView = React.createElement(ProductViewWrapper, null);
- }
- return React.createElement(
- "div",
- { id: "app-root" },
- displayView
- );
- }
- }]);
-
- return App;
-}(React.Component);
-
-var AppWrapper = function (_React$Component2) {
- _inherits(AppWrapper, _React$Component2);
-
- function AppWrapper() {
- _classCallCheck(this, AppWrapper);
-
- return _possibleConstructorReturn(this, (AppWrapper.__proto__ || Object.getPrototypeOf(AppWrapper)).apply(this, arguments));
- }
-
- _createClass(AppWrapper, [{
- key: "render",
- value: function render() {
- return React.createElement(
- Provider,
- { store: store },
- React.createElement(App, null)
- );
- }
- }]);
-
- return AppWrapper;
-}(React.Component);
-
-ReactDOM.render(React.createElement(AppWrapper, null), document.getElementById('explore-content'));
diff --git a/httpdocs/theme/react/assets/css/carousel.css b/httpdocs/theme/react/assets/css/carousel.css
index 2f4e3b0bb..0bae20327 100644
--- a/httpdocs/theme/react/assets/css/carousel.css
+++ b/httpdocs/theme/react/assets/css/carousel.css
@@ -1 +1 @@
-.score-info{text-align:center}.score-info .score-number{width:100%;text-align:center;margin-bottom:5px}.score-info .score-bar-container{width:100%;height:10px;background:#ccc;margin-bottom:5px}.score-info .score-bar-container .score-bar{height:9px;background-color:#30c830;border-bottom:1px solid #2bb32b}#carousel-module-container{width:100%;float:left;position:relative}#carousel-module-container #carousels-module{width:100%;float:left;position:relative}#carousel-module-container .container{width:100% !important;max-width:100% !important;padding:0}#carousel-module-container .product-carousel{padding-bottom:10px;border-bottom:0 solid #ccc}#carousel-module-container .product-carousel .product-carousel-header{height:auto;overflow:auto;width:100%}#carousel-module-container .product-carousel .product-carousel-header h2{font-size:25px !important;float:left;display:block;width:auto;padding-right:20px;position:relative;width:auto !important;margin-bottom:20px;line-height:30px}#carousel-module-container .product-carousel .product-carousel-header h2 a{color:#007aa6}#carousel-module-container .product-carousel .product-carousel-header h2 i,#carousel-module-container .product-carousel .product-carousel-header h2 span.glyphicon{display:inline-block;position:absolute;right:0;top:8px;font-size:16px}#carousel-module-container .product-carousel .product-carousel-wrapper{width:100%;height:120px;position:relative}#carousel-module-container .product-carousel .product-carousel-wrapper .product-carousel-left{position:absolute;top:0;left:0;height:100%}#carousel-module-container .product-carousel .product-carousel-wrapper .product-carousel-right{right:0;position:absolute;top:0;width:10px;height:100%}#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow{position:absolute;top:50%;width:50px;height:50px;margin-top:-35px;border-radius:100%;border:1px solid #ccc;background-color:white;z-index:10;margin-left:-25px;cursor:pointer;opacity:1 !important;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow i,#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow span.glyphicon{position:absolute;top:50%;left:50%;margin-left:-7px;margin-top:-7px;color:#2673b0}#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow:active{background-color:#e6e6e6}#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow.disabled{color:darkgray}#carousel-module-container .product-carousel .product-carousel-wrapper:hover .carousel-arrow{opacity:1}#carousel-module-container .product-carousel .product-carousel-container{width:100%;overflow:hidden;position:relative;height:120px}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-slider{position:absolute;top:0;left:0;height:120px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item{float:left;height:120px}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item figure{margin:0;width:100%;float:left;margin-bottom:10px}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item figure img{height:48px;width:48px;float:left}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item .product-info span{display:block;float:left;width:100%;line-height:14px;height:auto}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item .product-info span.product-info-title{color:#007aa6;display:block}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item .product-info span.product-info-user{color:#666}#carousel-module-container .product-carousel.one .product-carousel-container .product-carousel-item .product-info span{height:22px;line-height:22px}#carousel-module-container .product-carousel.one .product-carousel-container .product-carousel-item .product-info span.product-info-title{text-overflow:ellipsis;word-break:break-word;overflow:hidden;white-space:nowrap;padding-right:20px;font-size:16px}#carousel-module-container .product-carousel.one .product-carousel-container .product-carousel-item .product-info span.product-info-user{font-size:15px}#carousel-module-container .product-carousel.two .product-carousel-wrapper{height:220px}#carousel-module-container .product-carousel.two .product-carousel-container{height:inherit !important}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider{height:inherit !important}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item{padding:10px;height:inherit !important}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-carousel-item-wrapper{width:100%;height:100%;border:1px solid #ccc;border-radius:5px;position:relative}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item a{display:block;width:100%;height:inherit !important}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item figure{border-bottom:1px solid #ccc;margin-bottom:0;height:50%;overflow:hidden;position:absolute;top:0;left:0;width:100%}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item figure img{height:100%;width:100%}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info{height:100%;padding:5px;font-size:14px;position:relative}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info span{color:#888;font-size:12px}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info span.product-info-title{max-height:37px;overflow:hidden;margin-bottom:5px;color:#007aa6}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info .score-info{position:absolute;bottom:5px;width:40%;right:5px}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info .score-info .score-number{margin-bottom:2px;font-size:11px;line-height:12px;color:#2673b0}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info .plings{position:absolute;bottom:5px;left:5px}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info .plings img{width:20px;height:20px}#carousel-module-container.app-images-hub{float:none;margin:0 auto;padding:0 10px}
\ No newline at end of file
+.score-info{text-align:center}.score-info .score-number{width:100%;text-align:center;margin-bottom:5px}.score-info .score-bar-container{width:100%;height:10px;background:#ccc;margin-bottom:5px}.score-info .score-bar-container .score-bar{height:9px;background-color:#30c830;border-bottom:1px solid #2bb32b}#carousel-module-container{width:100%;float:left;position:relative}#carousel-module-container #carousels-module{width:100%;float:left;position:relative}#carousel-module-container .container{width:100% !important;max-width:100% !important;padding:0}#carousel-module-container .product-carousel{padding-bottom:10px;border-bottom:0 solid #ccc}#carousel-module-container .product-carousel .product-carousel-header{height:auto;overflow:auto;width:100%}#carousel-module-container .product-carousel .product-carousel-header h2{font-size:25px !important;float:left;display:block;width:auto;padding-right:20px;position:relative;width:auto !important;margin-bottom:20px;line-height:30px}#carousel-module-container .product-carousel .product-carousel-header h2 a{color:#007aa6}#carousel-module-container .product-carousel .product-carousel-header h2 i,#carousel-module-container .product-carousel .product-carousel-header h2 span.glyphicon{display:inline-block;position:absolute;right:0;top:8px;font-size:16px}#carousel-module-container .product-carousel .product-carousel-wrapper{width:100%;height:120px;position:relative}#carousel-module-container .product-carousel .product-carousel-wrapper .product-carousel-left{position:absolute;top:0;left:0;height:100%}#carousel-module-container .product-carousel .product-carousel-wrapper .product-carousel-right{right:0;position:absolute;top:0;width:10px;height:100%}#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow{position:absolute;top:50%;width:50px;height:50px;margin-top:-35px;border-radius:100%;border:1px solid #ccc;background-color:white;z-index:10;margin-left:-25px;cursor:pointer;opacity:1 !important;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow i,#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow span.glyphicon{position:absolute;top:50%;left:50%;margin-left:-7px;margin-top:-7px;color:#2673b0}#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow:active{background-color:#e6e6e6}#carousel-module-container .product-carousel .product-carousel-wrapper .carousel-arrow.disabled{color:darkgray}#carousel-module-container .product-carousel .product-carousel-wrapper:hover .carousel-arrow{opacity:1}#carousel-module-container .product-carousel .product-carousel-container{width:100%;overflow:hidden;position:relative;height:120px}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-slider{position:absolute;top:0;left:0;height:120px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-o-transition:all .2s ease-out;transition:all .2s ease-out}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item{float:left;height:120px}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item figure{margin:0;width:100%;float:left;margin-bottom:10px}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item figure img{height:48px;width:48px;float:left}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item .product-info span{display:block;float:left;width:100%;line-height:14px;height:auto}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item .product-info span.product-info-title{color:#007aa6;display:block}#carousel-module-container .product-carousel .product-carousel-container .product-carousel-item .product-info span.product-info-user{color:#666}#carousel-module-container .product-carousel.one .product-carousel-container .product-carousel-item .product-info span{height:22px;line-height:22px}#carousel-module-container .product-carousel.one .product-carousel-container .product-carousel-item .product-info span.product-info-title{text-overflow:ellipsis;word-break:break-word;overflow:hidden;white-space:nowrap;padding-right:20px;font-size:16px}#carousel-module-container .product-carousel.one .product-carousel-container .product-carousel-item .product-info span.product-info-user{font-size:15px}#carousel-module-container .product-carousel.two .product-carousel-wrapper{height:220px}#carousel-module-container .product-carousel.two .product-carousel-container{height:inherit !important}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider{height:inherit !important}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item{padding:10px;height:inherit !important}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-carousel-item-wrapper{width:100%;height:100%;border:1px solid #ccc;border-radius:5px;position:relative}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item a{display:block;width:100%;height:inherit !important}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item figure{border-bottom:1px solid #ccc;margin-bottom:0;height:50%;overflow:hidden;position:absolute;top:0;left:0;width:100%}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item figure img{height:100%;width:100%}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info{height:100%;padding:5px;font-size:14px;position:relative}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info span{color:#888;font-size:12px}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info span.product-info-title{max-height:37px;overflow:hidden;margin-bottom:5px;color:#007aa6}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info .score-info{position:absolute;bottom:5px;width:40%;right:5px}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info .score-info .score-number{margin-bottom:2px;font-size:11px;line-height:12px;color:#2673b0}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info .plings{position:absolute;bottom:5px;left:5px}#carousel-module-container .product-carousel.two .product-carousel-container .product-carousel-slider .product-carousel-item .product-info .plings img{width:20px;height:20px}#carousel-module-container.app-images-hub{float:none;margin:0 auto;padding:0 10px;display:none !important}
\ No newline at end of file
diff --git a/httpdocs/theme/react/assets/css/pling-section.css b/httpdocs/theme/react/assets/css/pling-section.css
index 54df16b9e..6dabfa544 100644
--- a/httpdocs/theme/react/assets/css/pling-section.css
+++ b/httpdocs/theme/react/assets/css/pling-section.css
@@ -1 +1 @@
-#pling-section-content{width:100%;height:100%;display:flex;flex-flow:column nowrap}#pling-section-content a{cursor:pointer}#pling-section-content h1{text-align:center}#pling-section-content h2.focused{text-decoration:underline}#pling-section-content .pling-section-header{width:100%;height:300px;background-color:#f1f1f1;display:flex;justify-content:center;flex-flow:column nowrap;font-size:32px}#pling-section-content .pling-section-header>div{text-align:center}#pling-section-content .pling-section-header .score-container>span{font-size:small;font-weight:bold;padding:5px}#pling-section-content .pling-section-header .score-container .score-bar-container{width:300px;height:20px;background:#ccc;margin-bottom:5px;display:inline-block;font-size:small}#pling-section-content .pling-section-header .score-container .score-bar-container .score-bar{height:20px;background-color:#286090;border-bottom:0 solid #22537c;color:#fff}#pling-section-content .supporters-container>ul{list-style:none;padding:0}#pling-section-content .supporters-container>ul>li{margin:3px;display:inline-block;float:left}#pling-section-content .supporters-container>ul>li img{width:100px;height:100px}#pling-section-content .supporters-container>ul>li .username{background-color:#282C34;color:#fff;text-align:center;font-size:small;padding:3px;max-width:100px}#pling-section-content .pling-section-tabs{display:block;margin:0 auto}#pling-section-content .pling-section-detail{display:flex;width:1200px;margin:0 auto;flex-flow:row wrap}#pling-section-content .pling-section-detail .pling-section-detail-left{width:200px;text-align:right}#pling-section-content .pling-section-detail .pling-section-detail-left ul.pling-section-detail-ul{list-style-type:none;padding:0px}#pling-section-content .pling-section-detail .pling-section-detail-left ul.pling-section-detail-ul li{margin:5px}#pling-section-content .pling-section-detail .pling-section-detail-right{width:200px;margin:5px}#pling-section-content .pling-section-detail .pling-section-detail-right .btnSupporter{-moz-box-align:center;align-items:center;backface-visibility:hidden;background-color:#286090;border-radius:9999px;border:medium none;box-sizing:border-box;color:#fff !important;display:inline-flex;font-size:1.4rem !important;font-weight:800;height:unset;-moz-box-pack:center;justify-content:center;padding:.875rem 1.5rem;position:relative;pointer-events:unset;text-align:center;text-decoration:none;text-transform:none;transition:all 300ms cubic-bezier(.19, 1, .22, 1) 0s;-moz-user-select:none;white-space:unset;width:100%}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container{border-color:#e5e3dd;border-style:solid;border-width:1px;border-radius:4px;box-shadow:none;background-color:#fff;overflow:hidden;font-size:small;margin-top:10px}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tiers{display:block;padding:1rem;margin:0rem;border-bottom:1px solid #e5e3dd;-moz-box-align:center;align-items:center;place-content:flex-start space-between;box-sizing:border-box;display:flex;flex-flow:row nowrap;-moz-box-pack:justify;transition:all 300ms cubic-bezier(.19, 1, .22, 1) 0s}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tiers h5{color:#241e12;font-family:aktiv-grotesk,sans-serif;font-weight:700 !important;margin:0px;position:relative;text-transform:uppercase;transition:all 300ms cubic-bezier(.19, 1, .22, 1) 0s;font-size:.875rem !important;line-height:1.5 !important}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container{box-sizing:border-box;transition:all 300ms cubic-bezier(.19, 1, .22, 1) 0s;padding:1rem;margin:0rem;border-bottom:1px solid #e5e3dd;text-align:center}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container span{display:inline-block}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container ul{list-style-type:none;padding:0px;display:inline-block}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container ul li{float:left;margin:2px}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container ul li img{width:25px;height:25px}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container .join{display:flex;justify-content:center;flex-flow:column}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container .join input.free-amount{opacity:.95;margin-top:-8px;color:#000;font-size:18px;width:40px;margin:0;margin-top:0px;margin-top:0;border:0;border-bottom-color:currentcolor;border-bottom-style:none;border-bottom-width:0px;border-bottom:1px solid #d0d0d0;padding:0;box-shadow:none;background:none}#pling-section-content .pling-section-detail .pling-section-detail-middle{flex:2 0px;padding:10px 20px;display:flex;justify-content:center}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer{border:1px solid #ccc;border-radius:5px;background-image:url(../img/home/back3.jpg);padding:8px;margin:0px 5px 5px 0;width:320px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer div.title{font-size:11pt;font-weight:bold;border-bottom:1px solid #ccc;height:20px;padding-left:5px;margin-bottom:10px;color:#888888;font-size:9pt}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol{list-style:none;padding-left:5px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li{padding:5px 0px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .creatorrow,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .creatorrow{font-size:small}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .creatorrow figure img,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .creatorrow figure img{width:100px;height:100px;border:1px solid #dbdbdb;-webkit-border-radius:999px;-moz-border-radius:999px;border-radius:999px;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .creatorrow .userinfo .userinfo-title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .creatorrow .userinfo .userinfo-title{font-weight:bold}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .creatorrow .userinfo ul.userinfo-detail li,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .creatorrow .userinfo ul.userinfo-detail li{padding:1px 2px;border:0px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow{padding-bottom:5px;padding-top:5px;font-size:small}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .rating,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .rating{width:60px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .time,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .time{font-size:smaller}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .cntComments,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .cntComments{font-size:smaller;display:block;padding-top:5px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .defaultProjectAvatar,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .defaultProjectAvatar{width:50px;height:50px;color:#3B658A;line-height:50px;text-align:center;background-color:#e8eaf6}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .productimg,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .productimg{width:50px;height:50px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-user,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-user{width:42px;height:42px;border-radius:100%}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .commenttext,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .commenttext{padding-left:20px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-info span,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-info span{display:block;float:left;width:100%;line-height:14px;height:auto}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-info span.product-info-title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-info span.product-info-title{color:#444444;font-size:10pt;font-weight:bold;display:block}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-info span.product-info-date,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-info span.product-info-date{padding-top:10px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-info span.product-info-user,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-info span.product-info-user{color:#666}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .score-info,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .score-info{text-align:center;width:80%}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .score-info .score-number,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .score-info .score-number{width:100%;text-align:center;margin-bottom:0px;font-size:8pt}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .score-info .score-bar-container,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .score-info .score-bar-container{width:100%;height:10px;background:#ccc;margin-bottom:5px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .score-info .score-bar-container .score-bar,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .score-info .score-bar-container .score-bar{height:9px;background-color:#30c830;border-bottom:1px solid #2bb32b}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .info-row,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .info-row{display:block;width:100%;color:#777777}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .title{color:#444444;font-size:10pt;font-weight:bold}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .content,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .content{font-size:13px;line-height:1}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .info-row span.comment-counter,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .info-row span.comment-counter{float:right}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li+li,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li+li{border-top:1px solid #ccc}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap{float:left;width:100%;padding:.3em;border:.35em solid #dee0e0;border-radius:5px;height:14em;margin-bottom:1em;background:white;width:115px;height:200px;margin-right:10px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-ms-transition:all .2s ease-out;-o-transition:all .2s ease-out;text-align:center;position:relative;padding-top:50px}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap figure{padding:.25em;border:1px solid #dbdbdb;background:#f6f6f6;border-radius:999px;width:50px}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap figure img{width:40px;height:40px;border:1px solid #dbdbdb;-webkit-border-radius:999px;-moz-border-radius:999px;border-radius:999px;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap h3{font-size:13px;font-weight:normal;word-wrap:break-word;line-height:15px;padding:0;margin:0}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap span.small{font-size:13px;color:#444;position:absolute;bottom:5px;right:5px}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap div.projecttitle{font-size:11px}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap span.rank{font-size:14px;position:absolute;bottom:5px;left:5px;color:#444;font-weight:bold}
\ No newline at end of file
+#pling-section-content{width:100%;height:100%;display:flex;flex-flow:column nowrap}#pling-section-content a{cursor:pointer}#pling-section-content h1{text-align:center}#pling-section-content h2.focused{text-decoration:underline}#pling-section-content .pling-section-header{width:100%;height:300px;background-color:#f1f1f1;display:flex;justify-content:center;flex-flow:column nowrap;font-size:32px}#pling-section-content .pling-section-header>div{text-align:center}#pling-section-content .pling-section-header .score-container>span{font-size:small;font-weight:bold;padding:5px}#pling-section-content .pling-section-header .score-container .score-bar-container{width:300px;height:20px;background:#ccc;margin-bottom:5px;display:inline-block;font-size:small}#pling-section-content .pling-section-header .score-container .score-bar-container .score-bar{height:20px;background-color:#286090;border-bottom:0 solid #22537c;color:#fff}#pling-section-content .supporters-container>ul{list-style:none;padding:0}#pling-section-content .supporters-container>ul>li{margin:3px;display:inline-block;float:left}#pling-section-content .supporters-container>ul>li img{width:100px;height:100px}#pling-section-content .supporters-container>ul>li .username{background-color:#282C34;color:#fff;text-align:center;font-size:small;padding:3px;max-width:100px}#pling-section-content .pling-section-tabs{display:block;margin:0 auto}#pling-section-content .pling-section-detail{display:flex;width:1200px;margin:0 auto;flex-flow:row wrap}#pling-section-content .pling-section-detail .pling-section-detail-left{width:200px;text-align:right}#pling-section-content .pling-section-detail .pling-section-detail-left ul.pling-section-detail-ul{list-style-type:none;padding:0px}#pling-section-content .pling-section-detail .pling-section-detail-left ul.pling-section-detail-ul li{margin:5px}#pling-section-content .pling-section-detail .pling-section-detail-right{width:200px;margin:5px}#pling-section-content .pling-section-detail .pling-section-detail-right .btnSupporter{-moz-box-align:center;align-items:center;backface-visibility:hidden;background-color:#286090;border-radius:9999px;border:medium none;box-sizing:border-box;color:#fff !important;display:inline-flex;font-size:1.4rem !important;font-weight:800;height:unset;-moz-box-pack:center;justify-content:center;padding:.875rem 1.5rem;position:relative;pointer-events:unset;text-align:center;text-decoration:none;text-transform:none;transition:all 300ms cubic-bezier(.19, 1, .22, 1) 0s;-moz-user-select:none;white-space:unset;width:100%}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container{border-color:#e5e3dd;border-style:solid;border-width:1px;border-radius:4px;box-shadow:none;background-color:#fff;overflow:hidden;font-size:small;margin-top:10px}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tiers{display:block;padding:1rem;margin:0rem;border-bottom:1px solid #e5e3dd;-moz-box-align:center;align-items:center;place-content:flex-start space-between;box-sizing:border-box;display:flex;flex-flow:row nowrap;-moz-box-pack:justify;transition:all 300ms cubic-bezier(.19, 1, .22, 1) 0s}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tiers h5{color:#241e12;font-family:aktiv-grotesk,sans-serif;font-weight:700 !important;margin:0px;position:relative;text-transform:uppercase;transition:all 300ms cubic-bezier(.19, 1, .22, 1) 0s;font-size:.875rem !important;line-height:1.5 !important}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container{box-sizing:border-box;transition:all 300ms cubic-bezier(.19, 1, .22, 1) 0s;padding:1rem;margin:0rem;border-bottom:1px solid #e5e3dd;text-align:center}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container span{display:inline-block}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container ul{list-style-type:none;padding:0px;display:inline-block}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container ul li{float:left;margin:2px}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container ul li img{width:25px;height:25px}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container .join{display:flex;justify-content:center;flex-flow:column}#pling-section-content .pling-section-detail .pling-section-detail-right .support-container .tier-container .join input.free-amount{opacity:.95;margin-top:-8px;color:#000;font-size:18px;width:40px;margin:0;margin-top:0px;margin-top:0;border:0;border-bottom-color:currentcolor;border-bottom-style:none;border-bottom-width:0px;border-bottom:1px solid #d0d0d0;padding:0;box-shadow:none;background:none}#pling-section-content .pling-section-detail .pling-section-detail-middle{flex:2 0px;padding:10px 20px;display:flex;justify-content:center}#pling-section-content .pling-section-detail .pling-section-detail-middle span.colorGrey{color:#ccc}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer{border:1px solid #ccc;border-radius:5px;background-image:url(../img/home/back3.jpg);padding:8px;margin:0px 5px 5px 0;width:320px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer div.title{font-size:11pt;font-weight:bold;border-bottom:1px solid #ccc;height:20px;padding-left:5px;margin-bottom:10px;color:#888888;font-size:9pt}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol{list-style:none;padding-left:5px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li{padding:5px 0px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .creatorrow,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .creatorrow{padding-bottom:5px;padding-top:5px;font-size:small}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .creatorrow figure img,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .creatorrow figure img{width:50px;height:50px;border:1px solid #dbdbdb;-webkit-border-radius:999px;-moz-border-radius:999px;border-radius:999px;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .creatorrow .userinfo .userinfo-title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .creatorrow .userinfo .userinfo-title{font-weight:bold}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .creatorrow .userinfo ul.userinfo-detail li,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .creatorrow .userinfo ul.userinfo-detail li{padding:1px 2px;border:0px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow{padding-bottom:5px;padding-top:5px;font-size:small}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .rating,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .rating{width:60px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .time,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .time{font-size:smaller}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .cntComments,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .cntComments{font-size:smaller;display:block;padding-top:5px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .defaultProjectAvatar,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .defaultProjectAvatar{width:50px;height:50px;color:#3B658A;line-height:50px;text-align:center;background-color:#e8eaf6}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .productimg,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .productimg{width:50px;height:50px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-user,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-user{width:42px;height:42px;border-radius:100%}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .commenttext,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .commenttext{padding-left:20px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-info span,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-info span{display:block;float:left;width:100%;line-height:14px;height:auto}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-info span.product-info-title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-info span.product-info-title{color:#444444;font-size:10pt;font-weight:bold;display:block}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-info span.product-info-date,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-info span.product-info-date{padding-top:10px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .product-info span.product-info-user,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .product-info span.product-info-user{color:#666}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .score-info,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .score-info{text-align:center;width:80%}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .score-info .score-number,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .score-info .score-number{width:100%;text-align:center;margin-bottom:0px;font-size:8pt}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .score-info .score-bar-container,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .score-info .score-bar-container{width:100%;height:10px;background:#ccc;margin-bottom:5px}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .productrow .score-info .score-bar-container .score-bar,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .productrow .score-info .score-bar-container .score-bar{height:9px;background-color:#30c830;border-bottom:1px solid #2bb32b}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .info-row,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .info-row{display:block;width:100%;color:#777777}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .title,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .title{color:#444444;font-size:10pt;font-weight:bold}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .content,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .content{font-size:13px;line-height:1}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li .info-row span.comment-counter,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li .info-row span.comment-counter{float:right}#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ul li+li,#pling-section-content .pling-section-detail .pling-section-detail-middle .panelContainer ol li+li{border-top:1px solid #ccc}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap{float:left;width:100%;padding:.3em;border:.35em solid #dee0e0;border-radius:5px;height:14em;margin-bottom:1em;background:white;width:115px;height:200px;margin-right:10px;-webkit-transition:all .2s ease-out;-moz-transition:all .2s ease-out;-ms-transition:all .2s ease-out;-o-transition:all .2s ease-out;text-align:center;position:relative;padding-top:80px}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap figure{padding:.25em;border:1px solid #dbdbdb;background:#f6f6f6;border-radius:999px;width:50px}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap figure img{width:40px;height:40px;border:1px solid #dbdbdb;-webkit-border-radius:999px;-moz-border-radius:999px;border-radius:999px;-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap h3{font-size:13px;font-weight:normal;word-wrap:break-word;line-height:15px;padding:0;margin:0}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap span.small{font-size:13px;color:#444;position:absolute;bottom:5px;right:5px}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap div.projecttitle{font-size:11px}#pling-section-content .pling-section-detail .pling-section-detail-middle #recentplinged-list .product-wrap span.rank{font-size:14px;position:absolute;bottom:5px;left:5px;color:#444;font-weight:bold}
\ No newline at end of file
diff --git a/httpdocs/theme/react/assets/less/carousel.less b/httpdocs/theme/react/assets/less/carousel.less
index b9548d907..85600cca4 100644
--- a/httpdocs/theme/react/assets/less/carousel.less
+++ b/httpdocs/theme/react/assets/less/carousel.less
@@ -1,312 +1,313 @@
-out: ../css/carousel.css, sourcemap: true, compress: true
+// out: ../css/carousel.css, sourcemap: true, compress: true
@import "elements.less";
.score-info {
text-align: center;
.score-number {
width: 100%;
text-align: center;
margin-bottom: 5px;
}
.score-bar-container {
width: 100%;
height: 10px;
background: #ccc;
margin-bottom: 5px;
.score-bar {
height: 9px;
background-color: #30c830;
border-bottom: 1px solid darken( #30c830,5%);
}
}
}
#carousel-module-container {
width: 100%;
float: left;
position: relative;
#carousels-module {
width: 100%;
float: left;
position: relative;
}
.container {
width: 100% !important;
max-width: 100% !important;
padding: 0;
}
.product-carousel {
padding-bottom: 10px;
border-bottom: 0px solid #ccc;
.product-carousel-header {
height: auto;
overflow: auto;
width: 100%;
h2 {
font-size: 25px !important;
float: left;
display: block;
width: auto;
padding-right: 20px;
position: relative;
width: auto !important;
margin-bottom: 20px;
line-height: 30px;
a {
color: #007aa6;
}
i,
span.glyphicon{
display: inline-block;
position: absolute;
right: 0;
top: 8px;
font-size: 16px;
}
}
}
.product-carousel-wrapper {
width: 100%;
height: 120px;
position: relative;
.product-carousel-left {
position: absolute;
top: 0;
left: 0;
height: 100%;
}
.product-carousel-right {
right:0;
position: absolute;
top: 0;
width: 10px;
height: 100%;
}
.carousel-arrow {
position: absolute;
top: 50%;
width: 50px;
height: 50px;
margin-top: -35px;
border-radius: 100%;
border:1px solid #ccc;
background-color: white;
z-index: 10;
margin-left: -25px;
cursor: pointer;
opacity: 1 !important;
.transition();
i ,
span.glyphicon {
position: absolute;
top: 50%;
left: 50%;
margin-left: -7px;
margin-top: -7px;
color: #2673b0;
}
&:active {
background-color: darken(white,10%);
}
&.disabled {
color: darkgray;
}
}
&:hover {
.carousel-arrow {
opacity: 1;
}
}
}
.product-carousel-container {
width: 100%;
overflow: hidden;
position: relative;
height: 120px;
.product-carousel-slider {
position: absolute;
top: 0;
left: 0;
height: 120px;
.transition();
}
.product-carousel-item {
float: left;
height: 120px;
figure {
margin: 0;
width: 100%;
float: left;
margin-bottom: 10px;
img {
height: 48px;
width: 48px;
float: left;
}
}
.product-info {
span {
display: block;
float: left;
width: 100%;
line-height: 14px;
height: auto;
&.product-info-title {
color: #007aa6;
display: block;
}
&.product-info-user {
color: #666;
}
}
}
}
}
&.one {
.product-carousel-container .product-carousel-item .product-info span {
height: 22px;
line-height: 22px;
}
.product-carousel-container .product-carousel-item .product-info span.product-info-title {
text-overflow: ellipsis;
word-break: break-word;
overflow: hidden;
white-space: nowrap;
padding-right: 20px;
font-size: 16px;
}
.product-carousel-container .product-carousel-item .product-info span.product-info-user {
font-size: 15px;
}
}
&.two {
.product-carousel-wrapper {
height: 220px;
}
.product-carousel-container {
height: inherit !important;
.product-carousel-slider {
height: inherit !important;
.product-carousel-item {
padding: 10px;
height: inherit !important;
.product-carousel-item-wrapper {
width: 100%;
height: 100%;
border: 1px solid #ccc;
border-radius: 5px;
position: relative;
}
a {
display: block;
width: 100%;
height: inherit !important;
}
figure {
border-bottom: 1px solid #ccc;
margin-bottom: 0;
height: 50%;
overflow: hidden;
position: absolute;
top: 0;
left: 0;
width: 100%;
img {
height: 100%;
width: 100%;
}
}
.product-info {
height: 100%;
padding: 5px;
font-size: 14px;
position: relative;
span {
color: #888;
font-size: 12px;
&.product-info-title {
max-height: 37px;
overflow: hidden;
margin-bottom: 5px;
color: #007aa6;
}
}
.score-info {
position: absolute;
bottom: 5px;
width: 40%;
right: 5px;
.score-number {
margin-bottom: 2px;
font-size: 11px;
line-height: 12px;
color: #2673b0;
}
}
.plings
{
position: absolute;
bottom: 5px;
left: 5px;
img{
width: 20px;
height: 20px;
}
}
}
}
}
}
}
}
&.app-images-hub {
float: none;
margin: 0 auto;
padding: 0 10px;
+ display: none !important;
}
}
diff --git a/httpdocs/theme/react/assets/less/pling-section.less b/httpdocs/theme/react/assets/less/pling-section.less
index 287f4ca64..8434ad655 100644
--- a/httpdocs/theme/react/assets/less/pling-section.less
+++ b/httpdocs/theme/react/assets/less/pling-section.less
@@ -1,506 +1,513 @@
// out: ../css/pling-section.css, sourcemap: true, compress: true
#pling-section-content
{
width: 100%;
height: 100%;
display: flex;
flex-flow: column nowrap;
a{
cursor: pointer;
}
h1{
text-align: center;
}
h2{
&.focused
{
text-decoration: underline;
}
}
.pling-section-header{
width: 100%;
height: 300px;
background-color: #f1f1f1;
display: flex;
justify-content: center;
flex-flow: column nowrap;
font-size: 32px;
& > div{
text-align: center;
}
.score-container
{
&>span{
font-size: small;
font-weight: bold;
padding:5px;
}
.score-bar-container {
width: 300px;
height: 20px;
background: #ccc;
margin-bottom: 5px;
display: inline-block;
font-size: small;
.score-bar {
height: 20px;
background-color: #286090;
border-bottom: 0px solid darken( #286090,5%);
color:#fff;
}
}
}
}
.supporters-container{
& > ul{
list-style: none;
padding: 0;
&>li{
margin: 3px;
display: inline-block;
float: left;
img{
width: 100px;
height: 100px;
}
.username{
background-color: #282C34;
color: #fff;
text-align: center;
font-size: small;
padding:3px;
max-width: 100px;
}
}
}
}
.pling-section-tabs{
display: block;
margin: 0 auto;
}
.pling-section-detail
{
display: flex;
width: 1200px;
margin: 0 auto;
flex-flow: row wrap;
.pling-section-detail-left
{
width: 200px;
text-align: right;
ul.pling-section-detail-ul{
list-style-type: none;
padding: 0px;
li{
margin: 5px;
}
}
}
.pling-section-detail-right
{
width: 200px;
margin: 5px;
.btnSupporter{
-moz-box-align: center;
align-items: center;
backface-visibility: hidden;
background-color: #286090;
border-radius: 9999px;
border: medium none;
box-sizing: border-box;
color: rgb(255, 255, 255) !important;
display: inline-flex;
font-size: 1.4rem !important;
font-weight: 800;
height: unset;
-moz-box-pack: center;
justify-content: center;
padding: 0.875rem 1.5rem;
position: relative;
pointer-events: unset;
text-align: center;
text-decoration: none;
text-transform: none;
transition: all 300ms cubic-bezier(0.19, 1, 0.22, 1) 0s;
-moz-user-select: none;
white-space: unset;
width: 100%;
}
.support-container{
border-color: rgb(229, 227, 221);
border-style: solid;
border-width: 1px;
border-radius: 4px;
box-shadow: none;
background-color: rgb(255, 255, 255);
overflow: hidden;
font-size: small;
margin-top: 10px;
.tiers{
box-sizing: border-box;
display: block;
transition: all 300ms cubic-bezier(0.19, 1, 0.22, 1) 0s;
padding: 1rem;
margin: 0rem;
border-bottom: 1px solid rgb(229, 227, 221);
-moz-box-align: center;
align-items: center;
place-content: flex-start space-between;
box-sizing: border-box;
display: flex;
flex-flow: row nowrap;
-moz-box-pack: justify;
transition: all 300ms cubic-bezier(0.19, 1, 0.22, 1) 0s;
h5{
color: rgb(36, 30, 18);
font-family: aktiv-grotesk, sans-serif;
font-weight: 700 !important;
margin: 0px;
position: relative;
text-transform: uppercase;
transition: all 300ms cubic-bezier(0.19, 1, 0.22, 1) 0s;
font-size: 0.875rem !important;
line-height: 1.5 !important;
}
}
.tier-container{
box-sizing: border-box;
transition: all 300ms cubic-bezier(0.19, 1, 0.22, 1) 0s;
padding: 1rem;
margin: 0rem;
border-bottom: 1px solid rgb(229, 227, 221);
text-align: center;
span{
display: inline-block;
}
ul{
list-style-type: none;
padding:0px;
display: inline-block;
li{
float: left;
margin:2px;
img{
width: 25px;
height:25px;
}
}
}
.join{
display: flex;
justify-content: center;
flex-flow: column;
input.free-amount{
opacity: .95;
margin-top: -8px;
color: #000;
font-size: 18px;
width: 40px;
margin: 0;
margin-top: 0px;
margin-top: 0px;
margin-top: 0;
border: 0;
border-bottom-color: currentcolor;
border-bottom-style: none;
border-bottom-width: 0px;
border-bottom-color: currentcolor;
border-bottom-style: none;
border-bottom-width: 0px;
border-bottom: 1px solid #d0d0d0;
padding: 0;
box-shadow: none;
background: none;
}
}
}
}
}
.pling-section-detail-middle
{
+
flex: 2 0px;
padding: 10px 20px;
display: flex;
justify-content: center;
+ span.colorGrey{
+ color: #ccc;
+
+ }
.panelContainer{
border: 1px solid #ccc;
border-radius: 5px;
background-image: url(../img/home/back3.jpg);
padding: 8px;
margin: 0px 5px 5px 0;
width:320px;
div.title{
color: #888888;
font-size:11pt;
font-weight: bold;
border-bottom: 1px solid #ccc;
height: 20px;
padding-left: 5px;
margin-bottom: 10px;
color: #888888;
font-size: 9pt;
}
ul, ol {
list-style: none;
padding-left: 5px;
li {
padding: 5px 0px;
- .creatorrow{
+ .creatorrow{
+ padding-bottom: 5px;
+ padding-top: 5px;
font-size: small;
figure img {
- width: 100px;
- height: 100px;
+ width: 50px;
+ height: 50px;
border: 1px solid #dbdbdb;
-webkit-border-radius: 999px;
-moz-border-radius: 999px;
border-radius: 999px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
.userinfo{
.userinfo-title{
font-weight: bold;
}
ul.userinfo-detail{
li{
padding:1px 2px;
border: 0px;
}
}
}
}
.productrow
{
padding-bottom: 5px;
padding-top: 5px;
font-size: small;
-
+
.rating
{
width: 60px;
}
.time
{
font-size: smaller;
}
.cntComments
{
font-size: smaller;
display: block;
padding-top: 5px;
}
.defaultProjectAvatar{
width: 50px;
height: 50px;
color: #3B658A;
line-height: 50px;
text-align: center;
background-color: #e8eaf6;
}
.productimg
{
width:50px;
height:50px;
}
.product-user{
width: 42px;
height: 42px;
border-radius: 100%;
}
.commenttext{
padding-left: 20px;
}
.product-info {
span {
display: block;
float: left;
width: 100%;
line-height: 14px;
height: auto;
&.product-info-title {
color: #444444;
font-size: 10pt;
font-weight: bold;
display: block;
}
&.product-info-date{
padding-top: 10px;
}
&.product-info-user {
color: #666;
}
}
}
.score-info {
text-align: center;
width: 80%;
.score-number {
width: 100%;
text-align: center;
margin-bottom: 0px;
font-size: 8pt;
}
.score-bar-container {
width: 100%;
height: 10px;
background: #ccc;
margin-bottom: 5px;
.score-bar {
height: 9px;
background-color: #30c830;
border-bottom: 1px solid darken( #30c830,5%);
}
}
}
}
.title, .info-row {
display: block;
width: 100%;
color: #777777;
}
.title {
color: #444444;
font-size: 10pt;
font-weight: bold;
}
.content {
font-size: 13px;
line-height: 1;
}
.info-row {
/*overflow: auto;
*/
span {
/*
float: left;
display: inline-block;
font-size: 12px;
*/
&.comment-counter {
float: right;
}
}
}
}
li + li {
border-top:1px solid #ccc;
}
}
}
#recentplinged-list{
.product-wrap{
float: left;
width: 100%;
padding: 0.3em;
border: 0.35em solid #dee0e0;
border-radius: 5px;
height: 14em;
margin-bottom: 1em;
background: white;
width: 115px;
height: 200px;
margin-right: 10px;
-webkit-transition: all 0.2s ease-out;
-moz-transition: all 0.2s ease-out;
-ms-transition: all 0.2s ease-out;
-o-transition: all 0.2s ease-out;
position: relative;
text-align: center;
position: relative;
- padding-top:50px;
+ padding-top:80px;
figure {
padding: .25em;
border: 1px solid #dbdbdb;
background: #f6f6f6;
border-radius:999px;
width:50px;
img{
width:40px;
height: 40px;
border: 1px solid #dbdbdb;
-webkit-border-radius: 999px;
-moz-border-radius: 999px;
border-radius: 999px;
-webkit-background-clip: padding-box;
-moz-background-clip: padding;
background-clip: padding-box;
}
}
h3{
font-size: 13px;
font-weight: normal;
word-wrap: break-word;
line-height: 15px;
padding: 0;
margin: 0;
}
span.small {
font-size: 13px;
color: #444;
position: absolute;
bottom: 5px;
right: 5px;
}
div.projecttitle{
font-size: 11px;
}
span.rank {
font-size: 14px;
position: absolute;
bottom: 5px;
left: 5px;
color: #444;
font-weight: bold;
}
}
}
}
}
}
diff --git a/httpdocs/theme/react/bundle/app-supporters-bundle.js b/httpdocs/theme/react/bundle/app-supporters-bundle.js
index a4d63e245..82a8a4b0d 100644
--- a/httpdocs/theme/react/bundle/app-supporters-bundle.js
+++ b/httpdocs/theme/react/bundle/app-supporters-bundle.js
@@ -1,30 +1,365 @@
-!function(e){var t={};function n(r){if(t[r])return t[r].exports;var l=t[r]={i:r,l:!1,exports:{}};return e[r].call(l.exports,l,l.exports,n),l.l=!0,l.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var l in e)n.d(r,l,function(t){return e[t]}.bind(null,l));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=381)}({0:function(e,t,n){"use strict";e.exports=n(101)},101:function(e,t,n){"use strict";
-/** @license React v16.10.2
- * react.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var r=n(70),l="function"==typeof Symbol&&Symbol.for,a=l?Symbol.for("react.element"):60103,i=l?Symbol.for("react.portal"):60106,o=l?Symbol.for("react.fragment"):60107,u=l?Symbol.for("react.strict_mode"):60108,c=l?Symbol.for("react.profiler"):60114,s=l?Symbol.for("react.provider"):60109,f=l?Symbol.for("react.context"):60110,d=l?Symbol.for("react.forward_ref"):60112,p=l?Symbol.for("react.suspense"):60113,m=l?Symbol.for("react.suspense_list"):60120,h=l?Symbol.for("react.memo"):60115,v=l?Symbol.for("react.lazy"):60116;l&&Symbol.for("react.fundamental"),l&&Symbol.for("react.responder"),l&&Symbol.for("react.scope");var g="function"==typeof Symbol&&Symbol.iterator;function y(e){for(var t=e.message,n="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;rM.length&&M.push(e)}function F(e,t,n){return null==e?0:function e(t,n,r,l){var o=typeof t;"undefined"!==o&&"boolean"!==o||(t=null);var u=!1;if(null===t)u=!0;else switch(o){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case a:case i:u=!0}}if(u)return r(l,t,""===n?"."+D(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var c=0;ct}return!1}(t,n,l,r)&&(n=null),r||null===l?function(e){return!!me.call(ve,e)||!me.call(he,e)&&(pe.test(e)?ve[e]=!0:(he[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):l.mustUseProperty?e[l.propertyName]=null===n?3!==l.type&&"":n:(t=l.attributeName,r=l.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(l=l.type)||4===l&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function xe(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function Te(e){e._valueTracker||(e._valueTracker=function(e){var t=xe(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function Se(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=xe(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function _e(e,t){var n=t.checked;return l({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function Ce(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=Ee(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Pe(e,t){null!=(t=t.checked)&&ke(e,"checked",t,!1)}function Ne(e,t){Pe(e,t);var n=Ee(t.value),r=t.type;if(null!=n)"number"===r?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");t.hasOwnProperty("value")?ze(e,t.type,n):t.hasOwnProperty("defaultValue")&&ze(e,t.type,Ee(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function Oe(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!("submit"!==r&&"reset"!==r||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function ze(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function Ue(e,t){return e=l({children:void 0},t),(t=function(e){var t="";return r.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function Me(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l=t.length))throw i(Error(93));t=t[0]}n=t}null==n&&(n="")}e._wrapperState={initialValue:Ee(n)}}function Fe(e,t){var n=Ee(t.value),r=Ee(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=r&&(e.defaultValue=""+r)}function De(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(be,we);ye[t]=new ge(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(be,we);ye[t]=new ge(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(be,we);ye[t]=new ge(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){ye[e]=new ge(e,1,!1,e.toLowerCase(),null,!1)})),ye.xlinkHref=new ge("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){ye[e]=new ge(e,1,!1,e.toLowerCase(),null,!0)}));var Le={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function je(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ae(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?je(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Be,Ve=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,l){MSApp.execUnsafeLocalFunction((function(){return e(t,n)}))}:e}((function(e,t){if(e.namespaceURI!==Le.svg||"innerHTML"in e)e.innerHTML=t;else{for((Be=Be||document.createElement("div")).innerHTML=""+t.valueOf().toString()+" ",t=Be.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}));function We(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function $e(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var He={animationend:$e("Animation","AnimationEnd"),animationiteration:$e("Animation","AnimationIteration"),animationstart:$e("Animation","AnimationStart"),transitionend:$e("Transition","TransitionEnd")},Qe={},Ke={};function qe(e){if(Qe[e])return Qe[e];if(!He[e])return e;var t,n=He[e];for(t in n)if(n.hasOwnProperty(t)&&t in Ke)return Qe[e]=n[t];return e}Z&&(Ke=document.createElement("div").style,"AnimationEvent"in window||(delete He.animationend.animation,delete He.animationiteration.animation,delete He.animationstart.animation),"TransitionEvent"in window||delete He.transitionend.transition);var Ye=qe("animationend"),Xe=qe("animationiteration"),Ge=qe("animationstart"),Je=qe("transitionend"),Ze="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),et=!1,tt=[],nt=null,rt=null,lt=null,at=new Map,it=new Map,ot="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),ut="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function ct(e,t,n,r){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:r}}function st(e,t){switch(e){case"focus":case"blur":nt=null;break;case"dragenter":case"dragleave":rt=null;break;case"mouseover":case"mouseout":lt=null;break;case"pointerover":case"pointerout":at.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":it.delete(t.pointerId)}}function ft(e,t,n,r,l){return null===e||e.nativeEvent!==l?ct(t,n,r,l):(e.eventSystemFlags|=r,e)}function dt(e){if(null!==e.blockedOn)return!1;var t=_n(e.topLevelType,e.eventSystemFlags,e.nativeEvent);return null===t||(e.blockedOn=t,!1)}function pt(e,t,n){dt(e)&&n.delete(t)}function mt(){for(et=!1;0this.eventPool.length&&this.eventPool.push(e)}function It(e){e.eventPool=[],e.getPooled=Mt,e.release=Rt}l(Ut.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Ot)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Ot)},persist:function(){this.isPersistent=Ot},isPersistent:zt,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=zt,this._dispatchInstances=this._dispatchListeners=null}}),Ut.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Ut.extend=function(e){function t(){}function n(){return r.apply(this,arguments)}var r=this;t.prototype=r.prototype;var a=new t;return l(a,n.prototype),n.prototype=a,n.prototype.constructor=n,n.Interface=l({},r.Interface,e),n.extend=r.extend,It(n),n},It(Ut);var Ft=Ut.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Dt=Ut.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lt=Ut.extend({view:null,detail:null}),jt=Lt.extend({relatedTarget:null});function At(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var Bt={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Vt={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Wt={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $t(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Wt[e])&&!!t[e]}function Ht(){return $t}for(var Qt=Lt.extend({key:function(e){if(e.key){var t=Bt[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=At(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Vt[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:Ht,charCode:function(e){return"keypress"===e.type?At(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?At(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Kt=0,qt=0,Yt=!1,Xt=!1,Gt=Lt.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:Ht,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=Kt;return Kt=e.screenX,Yt?"mousemove"===e.type?e.screenX-t:0:(Yt=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=qt;return qt=e.screenY,Xt?"mousemove"===e.type?e.screenY-t:0:(Xt=!0,0)}}),Jt=Gt.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Zt=Gt.extend({dataTransfer:null}),en=Lt.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:Ht}),tn=Ut.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),nn=Gt.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),rn=[["blur","blur",0],["cancel","cancel",0],["click","click",0],["close","close",0],["contextmenu","contextMenu",0],["copy","copy",0],["cut","cut",0],["auxclick","auxClick",0],["dblclick","doubleClick",0],["dragend","dragEnd",0],["dragstart","dragStart",0],["drop","drop",0],["focus","focus",0],["input","input",0],["invalid","invalid",0],["keydown","keyDown",0],["keypress","keyPress",0],["keyup","keyUp",0],["mousedown","mouseDown",0],["mouseup","mouseUp",0],["paste","paste",0],["pause","pause",0],["play","play",0],["pointercancel","pointerCancel",0],["pointerdown","pointerDown",0],["pointerup","pointerUp",0],["ratechange","rateChange",0],["reset","reset",0],["seeked","seeked",0],["submit","submit",0],["touchcancel","touchCancel",0],["touchend","touchEnd",0],["touchstart","touchStart",0],["volumechange","volumeChange",0],["drag","drag",1],["dragenter","dragEnter",1],["dragexit","dragExit",1],["dragleave","dragLeave",1],["dragover","dragOver",1],["mousemove","mouseMove",1],["mouseout","mouseOut",1],["mouseover","mouseOver",1],["pointermove","pointerMove",1],["pointerout","pointerOut",1],["pointerover","pointerOver",1],["scroll","scroll",1],["toggle","toggle",1],["touchmove","touchMove",1],["wheel","wheel",1],["abort","abort",2],[Ye,"animationEnd",2],[Xe,"animationIteration",2],[Ge,"animationStart",2],["canplay","canPlay",2],["canplaythrough","canPlayThrough",2],["durationchange","durationChange",2],["emptied","emptied",2],["encrypted","encrypted",2],["ended","ended",2],["error","error",2],["gotpointercapture","gotPointerCapture",2],["load","load",2],["loadeddata","loadedData",2],["loadedmetadata","loadedMetadata",2],["loadstart","loadStart",2],["lostpointercapture","lostPointerCapture",2],["playing","playing",2],["progress","progress",2],["seeking","seeking",2],["stalled","stalled",2],["suspend","suspend",2],["timeupdate","timeUpdate",2],[Je,"transitionEnd",2],["waiting","waiting",2]],ln={},an={},on=0;on=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Bn(r)}}function Wn(){for(var e=window,t=An();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(!n)break;t=An((e=t.contentWindow).document)}return t}function $n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var Hn="$",Qn="/$",Kn="$?",qn="$!",Yn=null,Xn=null;function Gn(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function Jn(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var Zn="function"==typeof setTimeout?setTimeout:void 0,er="function"==typeof clearTimeout?clearTimeout:void 0;function tr(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function nr(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if(n===Hn||n===qn||n===Kn){if(0===t)return e;t--}else n===Qn&&t++}e=e.previousSibling}return null}var rr=Math.random().toString(36).slice(2),lr="__reactInternalInstance$"+rr,ar="__reactEventHandlers$"+rr,ir="__reactContainere$"+rr;function or(e){var t=e[lr];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ir]||n[lr]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=nr(e);null!==e;){if(n=e[lr])return n;e=nr(e)}return t}n=(e=n).parentNode}return null}function ur(e){return!(e=e[lr]||e[ir])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function cr(e){if(5===e.tag||6===e.tag)return e.stateNode;throw i(Error(33))}function sr(e){return e[ar]||null}var fr=null,dr=null,pr=null;function mr(){if(pr)return pr;var e,t,n=dr,r=n.length,l="value"in fr?fr.value:fr.textContent,a=l.length;for(e=0;e=br),kr=String.fromCharCode(32),xr={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Tr=!1;function Sr(e,t){switch(e){case"keyup":return-1!==gr.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function _r(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Cr=!1;var Pr={eventTypes:xr,extractEvents:function(e,t,n,r){var l;if(yr)e:{switch(e){case"compositionstart":var a=xr.compositionStart;break e;case"compositionend":a=xr.compositionEnd;break e;case"compositionupdate":a=xr.compositionUpdate;break e}a=void 0}else Cr?Sr(e,n)&&(a=xr.compositionEnd):"keydown"===e&&229===n.keyCode&&(a=xr.compositionStart);return a?(Er&&"ko"!==n.locale&&(Cr||a!==xr.compositionStart?a===xr.compositionEnd&&Cr&&(l=mr()):(dr="value"in(fr=r)?fr.value:fr.textContent,Cr=!0)),a=hr.getPooled(a,t,n,r),l?a.data=l:null!==(l=_r(n))&&(a.data=l),Nt(a),l=a):l=null,(e=wr?function(e,t){switch(e){case"compositionend":return _r(t);case"keypress":return 32!==t.which?null:(Tr=!0,kr);case"textInput":return(e=t.data)===kr&&Tr?null:e;default:return null}}(e,n):function(e,t){if(Cr)return"compositionend"===e||!yr&&Sr(e,t)?(e=mr(),pr=dr=fr=null,Cr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=document.documentMode,Jr={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Zr=null,el=null,tl=null,nl=!1;function rl(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return nl||null==Zr||Zr!==An(n)?null:("selectionStart"in(n=Zr)&&$n(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},tl&&Xr(tl,n)?null:(tl=n,(e=Ut.getPooled(Jr.select,el,e,t)).type="select",e.target=Zr,Nt(e),e))}var ll={eventTypes:Jr,extractEvents:function(e,t,n,r){var l,a=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(l=!a)){e:{a=Nn(a),l=m.onSelect;for(var i=0;iil||(e.current=al[il],al[il]=null,il--)}function ul(e,t){al[++il]=e.current,e.current=t}var cl={},sl={current:cl},fl={current:!1},dl=cl;function pl(e,t){var n=e.type.contextTypes;if(!n)return cl;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var l,a={};for(l in n)a[l]=t[l];return r&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ml(e){return null!=(e=e.childContextTypes)}function hl(e){ol(fl),ol(sl)}function vl(e){ol(fl),ol(sl)}function gl(e,t,n){if(sl.current!==cl)throw i(Error(168));ul(sl,t),ul(fl,n)}function yl(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,"function"!=typeof r.getChildContext)return n;for(var a in r=r.getChildContext())if(!(a in e))throw i(Error(108),G(t)||"Unknown",a);return l({},n,{},r)}function bl(e){var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||cl,dl=sl.current,ul(sl,t),ul(fl,fl.current),!0}function wl(e,t,n){var r=e.stateNode;if(!r)throw i(Error(169));n?(t=yl(e,t,dl),r.__reactInternalMemoizedMergedChildContext=t,ol(fl),ol(sl),ul(sl,t)):ol(fl),ul(fl,n)}var El=a.unstable_runWithPriority,kl=a.unstable_scheduleCallback,xl=a.unstable_cancelCallback,Tl=a.unstable_shouldYield,Sl=a.unstable_requestPaint,_l=a.unstable_now,Cl=a.unstable_getCurrentPriorityLevel,Pl=a.unstable_ImmediatePriority,Nl=a.unstable_UserBlockingPriority,Ol=a.unstable_NormalPriority,zl=a.unstable_LowPriority,Ul=a.unstable_IdlePriority,Ml={},Rl=void 0!==Sl?Sl:function(){},Il=null,Fl=null,Dl=!1,Ll=_l(),jl=1e4>Ll?_l:function(){return _l()-Ll};function Al(){switch(Cl()){case Pl:return 99;case Nl:return 98;case Ol:return 97;case zl:return 96;case Ul:return 95;default:throw i(Error(332))}}function Bl(e){switch(e){case 99:return Pl;case 98:return Nl;case 97:return Ol;case 96:return zl;case 95:return Ul;default:throw i(Error(332))}}function Vl(e,t){return e=Bl(e),El(e,t)}function Wl(e,t,n){return e=Bl(e),kl(e,t,n)}function $l(e){return null===Il?(Il=[e],Fl=kl(Pl,Ql)):Il.push(e),Ml}function Hl(){if(null!==Fl){var e=Fl;Fl=null,xl(e)}Ql()}function Ql(){if(!Dl&&null!==Il){Dl=!0;var e=0;try{var t=Il;Vl(99,(function(){for(;e=t&&(Ni=!0),e.firstContext=null)}function ra(e,t){if(Gl!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(Gl=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Xl){if(null===Yl)throw i(Error(308));Xl=t,Yl.dependencies={expirationTime:0,firstContext:t,responders:null}}else Xl=Xl.next=t;return e._currentValue}var la=!1;function aa(e){return{baseState:e,firstUpdate:null,lastUpdate:null,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function ia(e){return{baseState:e.baseState,firstUpdate:e.firstUpdate,lastUpdate:e.lastUpdate,firstCapturedUpdate:null,lastCapturedUpdate:null,firstEffect:null,lastEffect:null,firstCapturedEffect:null,lastCapturedEffect:null}}function oa(e,t){return{expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null,nextEffect:null}}function ua(e,t){null===e.lastUpdate?e.firstUpdate=e.lastUpdate=t:(e.lastUpdate.next=t,e.lastUpdate=t)}function ca(e,t){var n=e.alternate;if(null===n){var r=e.updateQueue,l=null;null===r&&(r=e.updateQueue=aa(e.memoizedState))}else r=e.updateQueue,l=n.updateQueue,null===r?null===l?(r=e.updateQueue=aa(e.memoizedState),l=n.updateQueue=aa(n.memoizedState)):r=e.updateQueue=ia(l):null===l&&(l=n.updateQueue=ia(r));null===l||r===l?ua(r,t):null===r.lastUpdate||null===l.lastUpdate?(ua(r,t),ua(l,t)):(ua(r,t),l.lastUpdate=t)}function sa(e,t){var n=e.updateQueue;null===(n=null===n?e.updateQueue=aa(e.memoizedState):fa(e,n)).lastCapturedUpdate?n.firstCapturedUpdate=n.lastCapturedUpdate=t:(n.lastCapturedUpdate.next=t,n.lastCapturedUpdate=t)}function fa(e,t){var n=e.alternate;return null!==n&&t===n.updateQueue&&(t=e.updateQueue=ia(t)),t}function da(e,t,n,r,a,i){switch(n.tag){case 1:return"function"==typeof(e=n.payload)?e.call(i,r,a):e;case 3:e.effectTag=-4097&e.effectTag|64;case 0:if(null==(a="function"==typeof(e=n.payload)?e.call(i,r,a):e))break;return l({},r,a);case 2:la=!0}return r}function pa(e,t,n,r,l){la=!1;for(var a=(t=fa(e,t)).baseState,i=null,o=0,u=t.firstUpdate,c=a;null!==u;){var s=u.expirationTime;sh?(v=f,f=null):v=f.sibling;var g=p(l,f,o[h],u);if(null===g){null===f&&(f=v);break}e&&f&&null===g.alternate&&t(l,f),i=a(g,i,h),null===s?c=g:s.sibling=g,s=g,f=v}if(h===o.length)return n(l,f),c;if(null===f){for(;hv?(g=h,h=null):g=h.sibling;var b=p(l,h,y.value,c);if(null===b){null===h&&(h=g);break}e&&h&&null===b.alternate&&t(l,h),o=a(b,o,v),null===f?s=b:f.sibling=b,f=b,h=g}if(y.done)return n(l,h),s;if(null===h){for(;!y.done;v++,y=u.next())null!==(y=d(l,y.value,c))&&(o=a(y,o,v),null===f?s=y:f.sibling=y,f=y);return s}for(h=r(l,h);!y.done;v++,y=u.next())null!==(y=m(h,l,v,y.value,c))&&(e&&null!==y.alternate&&h.delete(null===y.key?v:y.key),o=a(y,o,v),null===f?s=y:f.sibling=y,f=y);return e&&h.forEach((function(e){return t(l,e)})),s}return function(e,r,a,u){var c="object"==typeof a&&null!==a&&a.type===L&&null===a.key;c&&(a=a.props.children);var s="object"==typeof a&&null!==a;if(s)switch(a.$$typeof){case F:e:{for(s=a.key,c=r;null!==c;){if(c.key===s){if(7===c.tag?a.type===L:c.elementType===a.type){n(e,c.sibling),(r=l(c,a.type===L?a.props.children:a.props)).ref=Sa(e,c,a),r.return=e,e=r;break e}n(e,c);break}t(e,c),c=c.sibling}a.type===L?((r=ju(a.props.children,e.mode,u,a.key)).return=e,e=r):((u=Lu(a.type,a.key,a.props,null,e.mode,u)).ref=Sa(e,r,a),u.return=e,e=u)}return o(e);case D:e:{for(c=a.key;null!==r;){if(r.key===c){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=l(r,a.children||[])).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Bu(a,e.mode,u)).return=e,e=r}return o(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=l(r,a)).return=e,e=r):(n(e,r),(r=Au(a,e.mode,u)).return=e,e=r),o(e);if(Ta(a))return h(e,r,a,u);if(X(a))return v(e,r,a,u);if(s&&_a(e,a),void 0===a&&!c)switch(e.tag){case 1:case 0:throw e=e.type,i(Error(152),e.displayName||e.name||"Component")}return n(e,r)}}var Pa=Ca(!0),Na=Ca(!1),Oa={},za={current:Oa},Ua={current:Oa},Ma={current:Oa};function Ra(e){if(e===Oa)throw i(Error(174));return e}function Ia(e,t){ul(Ma,t),ul(Ua,e),ul(za,Oa);var n=t.nodeType;switch(n){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ae(null,"");break;default:t=Ae(t=(n=8===n?t.parentNode:t).namespaceURI||null,n=n.tagName)}ol(za),ul(za,t)}function Fa(e){ol(za),ol(Ua),ol(Ma)}function Da(e){Ra(Ma.current);var t=Ra(za.current),n=Ae(t,e.type);t!==n&&(ul(Ua,e),ul(za,n))}function La(e){Ua.current===e&&(ol(za),ol(Ua))}var ja={current:0};function Aa(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||n.data===Kn||n.data===qn))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if((64&t.effectTag)!==gt)return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Ba(e,t){return{responder:e,props:t}}var Va=M.ReactCurrentDispatcher,Wa=0,$a=null,Ha=null,Qa=null,Ka=null,qa=null,Ya=null,Xa=0,Ga=null,Ja=0,Za=!1,ei=null,ti=0;function ni(){throw i(Error(321))}function ri(e,t){if(null===t)return!1;for(var n=0;nXa&&gu(Xa=f)):(vu(f,c.suspenseConfig),a=c.eagerReducer===e?c.eagerState:e(a,c.action)),o=c,c=c.next}while(null!==c&&c!==r);s||(u=o,l=a),qr(a,t.memoizedState)||(Ni=!0),t.memoizedState=a,t.baseUpdate=u,t.baseState=l,n.lastRenderedState=a}return[t.memoizedState,n.dispatch]}function si(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},null===Ga?(Ga={lastEffect:null}).lastEffect=e.next=e:null===(t=Ga.lastEffect)?Ga.lastEffect=e.next=e:(n=t.next,t.next=e,e.next=n,Ga.lastEffect=e),e}function fi(e,t,n,r){var l=ii();Ja|=e,l.memoizedState=si(t,n,void 0,void 0===r?null:r)}function di(e,t,n,r){var l=oi();r=void 0===r?null:r;var a=void 0;if(null!==Ha){var i=Ha.memoizedState;if(a=i.destroy,null!==r&&ri(r,i.deps))return void si(0,n,a,r)}Ja|=e,l.memoizedState=si(t,n,a,r)}function pi(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function mi(){}function hi(e,t,n){if(!(25>ti))throw i(Error(301));var r=e.alternate;if(e===$a||null!==r&&r===$a)if(Za=!0,e={expirationTime:Wa,suspenseConfig:null,action:n,eagerReducer:null,eagerState:null,next:null},null===ei&&(ei=new Map),void 0===(n=ei.get(t)))ei.set(t,e);else{for(t=n;null!==t.next;)t=t.next;t.next=e}else{var l=Jo(),a=va.suspense;a={expirationTime:l=Zo(l,e,a),suspenseConfig:a,action:n,eagerReducer:null,eagerState:null,next:null};var o=t.last;if(null===o)a.next=a;else{var u=o.next;null!==u&&(a.next=u),o.next=a}if(t.last=a,0===e.expirationTime&&(null===r||0===r.expirationTime)&&null!==(r=t.lastRenderedReducer))try{var c=t.lastRenderedState,s=r(c,n);if(a.eagerReducer=r,a.eagerState=s,qr(s,c))return}catch(e){}nu(e,l)}}var vi={readContext:ra,useCallback:ni,useContext:ni,useEffect:ni,useImperativeHandle:ni,useLayoutEffect:ni,useMemo:ni,useReducer:ni,useRef:ni,useState:ni,useDebugValue:ni,useResponder:ni},gi={readContext:ra,useCallback:function(e,t){return ii().memoizedState=[e,void 0===t?null:t],e},useContext:ra,useEffect:function(e,t){return fi(516,192,e,t)},useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,fi(4,36,pi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return fi(4,36,e,t)},useMemo:function(e,t){var n=ii();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=ii();return t=void 0!==n?n(t):t,r.memoizedState=r.baseState=t,e=(e=r.queue={last:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=hi.bind(null,$a,e),[r.memoizedState,e]},useRef:function(e){return e={current:e},ii().memoizedState=e},useState:function(e){var t=ii();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={last:null,dispatch:null,lastRenderedReducer:ui,lastRenderedState:e}).dispatch=hi.bind(null,$a,e),[t.memoizedState,e]},useDebugValue:mi,useResponder:Ba},yi={readContext:ra,useCallback:function(e,t){var n=oi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ri(t,r[1])?r[0]:(n.memoizedState=[e,t],e)},useContext:ra,useEffect:function(e,t){return di(516,192,e,t)},useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,di(4,36,pi.bind(null,t,e),n)},useLayoutEffect:function(e,t){return di(4,36,e,t)},useMemo:function(e,t){var n=oi();t=void 0===t?null:t;var r=n.memoizedState;return null!==r&&null!==t&&ri(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)},useReducer:ci,useRef:function(){return oi().memoizedState},useState:function(e){return ci(ui)},useDebugValue:mi,useResponder:Ba},bi=null,wi=null,Ei=!1;function ki(e,t){var n=Iu(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function xi(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function Ti(e){if(Ei){var t=wi;if(t){var n=t;if(!xi(e,t)){if(!(t=tr(n.nextSibling))||!xi(e,t))return e.effectTag=e.effectTag&~bt|yt,Ei=!1,void(bi=e);ki(bi,n)}bi=e,wi=tr(t.firstChild)}else e.effectTag=e.effectTag&~bt|yt,Ei=!1,bi=e}}function Si(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;bi=e}function _i(e){if(e!==bi)return!1;if(!Ei)return Si(e),Ei=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!Jn(t,e.memoizedProps))for(t=wi;t;)ki(e,t),t=tr(t.nextSibling);if(Si(e),13===e.tag)if(null===(e=null!==(e=e.memoizedState)?e.dehydrated:null))e=wi;else e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if(n===Qn){if(0===t){e=tr(e.nextSibling);break e}t--}else n!==Hn&&n!==qn&&n!==Kn||t++}e=e.nextSibling}e=null}else e=bi?tr(e.stateNode.nextSibling):null;return wi=e,!0}function Ci(){wi=bi=null,Ei=!1}var Pi=M.ReactCurrentOwner,Ni=!1;function Oi(e,t,n,r){t.child=null===e?Na(t,null,n,r):Pa(t,e.child,n,r)}function zi(e,t,n,r,l){n=n.render;var a=t.ref;return na(t,l),r=li(e,t,n,r,a,l),null===e||Ni?(t.effectTag|=1,Oi(e,t,r,l),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=l&&(e.expirationTime=0),Ki(e,t,l))}function Ui(e,t,n,r,l,a){if(null===e){var i=n.type;return"function"!=typeof i||Fu(i)||void 0!==i.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=Lu(n.type,null,r,null,t.mode,a)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=i,Mi(e,t,i,r,l,a))}return i=e.child,lt)&&qo.set(e,t))}}function ru(e,t){e.expirationTime(e=e.nextKnownPendingLevel)?t:e:t}function au(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=$l(ou.bind(null,e));else{var t=lu(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var r=Jo();if(1073741823===t?r=99:1===t||2===t?r=95:r=0>=(r=10*(1073741821-t)-10*(1073741821-r))?99:250>=r?98:5250>=r?97:95,null!==n){var l=e.callbackPriority;if(e.callbackExpirationTime===t&&l>=r)return;n!==Ml&&xl(n)}e.callbackExpirationTime=t,e.callbackPriority=r,t=1073741823===t?$l(ou.bind(null,e)):Wl(r,iu.bind(null,e),{timeout:10*(1073741821-t)-jl()}),e.callbackNode=t}}}function iu(e,t){if(Go=0,t)return Qu(e,t=Jo()),au(e),null;var n=lu(e);if(0!==n){if(t=e.callbackNode,(Po&(bo|wo))!==go)throw i(Error(327));if(_u(),e===No&&n===zo||pu(e,n),null!==Oo){var r=Po;Po|=bo;for(var l=hu();;)try{bu();break}catch(t){mu(e,t)}if(Jl(),Po=r,ho.current=l,Uo===ko)throw t=Mo,pu(e,n),$u(e,n),au(e),t;if(null===Oo)switch(l=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,cu(e,n),r=Uo,No=null,r){case Eo:case ko:throw i(Error(345));case xo:if(2!==n){Qu(e,2);break}xu(e);break;case To:if($u(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=ku(l)),1073741823===Ro&&10<(l=jo+Ao-jl())){if(Lo){var a=e.lastPingedTime;if(0===a||a>=n){e.lastPingedTime=n,pu(e,n);break}}if(0!==(a=lu(e))&&a!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}e.timeoutHandle=Zn(xu.bind(null,e),l);break}xu(e);break;case So:if($u(e,n),n===(r=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=ku(l)),Lo&&(0===(l=e.lastPingedTime)||l>=n)){e.lastPingedTime=n,pu(e,n);break}if(0!==(l=lu(e))&&l!==n)break;if(0!==r&&r!==n){e.lastPingedTime=r;break}if(1073741823!==Io?r=10*(1073741821-Io)-jl():1073741823===Ro?r=0:(r=10*(1073741821-Ro)-5e3,0>(r=(l=jl())-r)&&(r=0),(n=10*(1073741821-n)-l)<(r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*mo(r/1960))-r)&&(r=n)),10=(r=0|o.busyMinDurationMs)?r=0:(l=0|o.busyDelayMs,r=(a=jl()-(10*(1073741821-a)-(0|o.timeoutMs||5e3)))<=l?0:l+r-a),10=t&&(Wl(97,(function(){return n._onComplete(),null})),Uo=Co)}function su(e,t){var n=Po;Po|=1;try{return e(t)}finally{(Po=n)===go&&Hl()}}function fu(e,t,n,r){var l=Po;Po|=4;try{return Vl(98,e.bind(null,t,n,r))}finally{(Po=l)===go&&Hl()}}function du(e,t){var n=Po;Po&=-2,Po|=yo;try{return e(t)}finally{(Po=n)===go&&Hl()}}function pu(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,er(n)),null!==Oo)for(n=Oo.return;null!==n;){var r=n;switch(r.tag){case 1:var l=r.type.childContextTypes;null!=l&&hl();break;case 3:Fa(),vl();break;case 5:La(r);break;case 4:Fa();break;case 13:case 19:ol(ja);break;case 10:ea(r)}n=n.return}No=e,Oo=Du(e.current,null),zo=t,Uo=Eo,Mo=null,Io=Ro=1073741823,Fo=null,Do=0,Lo=!1}function mu(e,t){for(;;){try{if(Jl(),ai(),null===Oo||null===Oo.return)return Uo=ko,Mo=t,null;e:{var n=e,r=Oo.return,l=Oo,a=t;if(t=zo,l.effectTag|=2048,l.firstEffect=l.lastEffect=null,null!==a&&"object"==typeof a&&"function"==typeof a.then){var i=a,o=0!=(1&ja.current),u=r;do{var c;if(c=13===u.tag){var s=u.memoizedState;if(null!==s)c=null!==s.dehydrated;else{var f=u.memoizedProps;c=void 0!==f.fallback&&(!0!==f.unstable_avoidThisFallback||!o)}}if(c){var d=u.updateQueue;if(null===d){var p=new Set;p.add(i),u.updateQueue=p}else d.add(i);if(0==(2&u.mode)){if(u.effectTag|=64,l.effectTag&=-2981,1===l.tag)if(null===l.alternate)l.tag=17;else{var m=oa(1073741823,null);m.tag=2,ca(l,m)}l.expirationTime=1073741823;break e}a=void 0,l=t;var h=n.pingCache;if(null===h?(h=n.pingCache=new so,a=new Set,h.set(i,a)):void 0===(a=h.get(i))&&(a=new Set,h.set(i,a)),!a.has(l)){a.add(l);var v=Ou.bind(null,n,i,l);i.then(v,v)}u.effectTag|=4096,u.expirationTime=t;break e}u=u.return}while(null!==u);a=Error((G(l.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a component higher in the tree to provide a loading indicator or placeholder to display."+J(l))}Uo!==_o&&(Uo=xo),a=Gi(a,l),u=r;do{switch(u.tag){case 3:i=a,u.effectTag|=4096,u.expirationTime=t,sa(u,fo(u,i,t));break e;case 1:i=a;var g=u.type,y=u.stateNode;if((64&u.effectTag)===gt&&("function"==typeof g.getDerivedStateFromError||null!==y&&"function"==typeof y.componentDidCatch&&(null===$o||!$o.has(y)))){u.effectTag|=4096,u.expirationTime=t,sa(u,po(u,i,t));break e}}u=u.return}while(null!==u)}Oo=Eu(Oo)}catch(e){t=e;continue}break}}function hu(){var e=ho.current;return ho.current=vi,null===e?vi:e}function vu(e,t){eDo&&(Do=e)}function yu(){for(;null!==Oo;)Oo=wu(Oo)}function bu(){for(;null!==Oo&&!Tl();)Oo=wu(Oo)}function wu(e){var t=eu(e.alternate,e,zo);return e.memoizedProps=e.pendingProps,null===t&&(t=Eu(e)),vo.current=null,t}function Eu(e){Oo=e;do{var t=Oo.alternate;if(e=Oo.return,(2048&Oo.effectTag)===gt){e:{var n=t,r=zo,a=(t=Oo).pendingProps;switch(t.tag){case 2:case 16:break;case 15:case 0:break;case 1:ml(t.type)&&hl();break;case 3:Fa(),vl(),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(null===n||null===n.child)&&_i(t)&&qi(t),Ai(t);break;case 5:La(t),r=Ra(Ma.current);var o=t.type;if(null!==n&&null!=t.stateNode)Bi(n,t,o,a,r),n.ref!==t.ref&&(t.effectTag|=128);else if(a){var u=Ra(za.current);if(_i(t)){o=void 0,n=(a=t).stateNode;var c=a.type,s=a.memoizedProps;switch(n[lr]=a,n[ar]=s,c){case"iframe":case"object":case"embed":wn("load",n);break;case"video":case"audio":for(var f=0;f<\/script>",f=s.removeChild(s.firstChild)):"string"==typeof n.is?f=f.createElement(s,{is:n.is}):(f=f.createElement(s),"select"===s&&(s=f,n.multiple?s.multiple=!0:n.size&&(s.size=n.size))):f=f.createElementNS(u,s),(s=f)[lr]=c,s[ar]=n,ji(n=s,t,!1,!1),t.stateNode=n,u=r;var d=Dn(o,a);switch(o){case"iframe":case"object":case"embed":wn("load",n),r=a;break;case"video":case"audio":for(r=0;ra.tailExpiration&&1a&&(a=n),(c=o.childExpirationTime)>a&&(a=c),o=o.sibling;r.childExpirationTime=a}if(null!==t)return t;null!==e&&(2048&e.effectTag)===gt&&(null===e.firstEffect&&(e.firstEffect=Oo.firstEffect),null!==Oo.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=Oo.firstEffect),e.lastEffect=Oo.lastEffect),1(e=e.childExpirationTime)?t:e}function xu(e){var t=Al();return Vl(99,Tu.bind(null,e,t)),null}function Tu(e,t){if(_u(),(Po&(bo|wo))!==go)throw i(Error(327));var n=e.finishedWork,r=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw i(Error(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var l=ku(n);if(e.firstPendingTime=l,r<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:r<=e.firstSuspendedTime&&(e.firstSuspendedTime=r-1),r<=e.lastPingedTime&&(e.lastPingedTime=0),r<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===No&&(Oo=No=null,zo=0),1u&&(s=u,u=o,o=s),s=Vn(w,o),f=Vn(w,u),s&&f&&(1!==k.rangeCount||k.anchorNode!==s.node||k.anchorOffset!==s.offset||k.focusNode!==f.node||k.focusOffset!==f.offset)&&((E=E.createRange()).setStart(s.node,s.offset),k.removeAllRanges(),o>u?(k.addRange(E),k.extend(f.node,f.offset)):(E.setEnd(f.node,f.offset),k.addRange(E))))),E=[];for(k=w;k=k.parentNode;)1===k.nodeType&&E.push({element:k,left:k.scrollLeft,top:k.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w=n?$i(e,t,n):(ul(ja,1&ja.current),null!==(t=Ki(e,t,n))?t.sibling:null);ul(ja,1&ja.current);break;case 19:if(r=t.childExpirationTime>=n,(64&e.effectTag)!==gt){if(r)return Qi(e,t,n);t.effectTag|=64}if(null!==(l=t.memoizedState)&&(l.rendering=null,l.tail=null),ul(ja,ja.current),!r)return null}return Ki(e,t,n)}Ni=!1}}else Ni=!1;switch(t.expirationTime=0,t.tag){case 2:if(r=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=yt),e=t.pendingProps,l=pl(t,sl.current),na(t,n),l=li(null,t,r,e,l,n),t.effectTag|=1,"object"==typeof l&&null!==l&&"function"==typeof l.render&&void 0===l.$$typeof){if(t.tag=1,ai(),ml(r)){var a=!0;bl(t)}else a=!1;t.memoizedState=null!==l.state&&void 0!==l.state?l.state:null;var o=r.getDerivedStateFromProps;"function"==typeof o&&ya(t,r,o,e),l.updater=ba,t.stateNode=l,l._reactInternalFiber=t,xa(t,r,e,n),t=Di(null,t,r,!0,a,n)}else t.tag=0,Oi(null,t,l,n),t=t.child;return t;case 16:if(l=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=yt),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(l),1!==l._status)throw l._result;switch(l=l._result,t.type=l,a=t.tag=function(e){if("function"==typeof e)return Fu(e)?1:0;if(null!=e){if((e=e.$$typeof)===$)return 11;if(e===K)return 14}return 2}(l),e=Kl(l,e),a){case 0:t=Ii(null,t,l,e,n);break;case 1:t=Fi(null,t,l,e,n);break;case 11:t=zi(null,t,l,e,n);break;case 14:t=Ui(null,t,l,Kl(l.type,e),r,n);break;default:throw i(Error(306),l,"")}return t;case 0:return r=t.type,l=t.pendingProps,Ii(e,t,r,l=t.elementType===r?l:Kl(r,l),n);case 1:return r=t.type,l=t.pendingProps,Fi(e,t,r,l=t.elementType===r?l:Kl(r,l),n);case 3:if(Li(t),null===(r=t.updateQueue))throw i(Error(282));if(l=null!==(l=t.memoizedState)?l.element:null,pa(t,r,t.pendingProps,null,n),(r=t.memoizedState.element)===l)Ci(),t=Ki(e,t,n);else{if((l=t.stateNode.hydrate)&&(wi=tr(t.stateNode.containerInfo.firstChild),bi=t,l=Ei=!0),l)for(n=Na(t,null,r,n),t.child=n;n;)n.effectTag=n.effectTag&~yt|bt,n=n.sibling;else Oi(e,t,r,n),Ci();t=t.child}return t;case 5:return Da(t),null===e&&Ti(t),r=t.type,l=t.pendingProps,a=null!==e?e.memoizedProps:null,o=l.children,Jn(r,l)?o=null:null!==a&&Jn(r,a)&&(t.effectTag|=16),Ri(e,t),4&t.mode&&1!==n&&l.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Oi(e,t,o,n),t=t.child),t;case 6:return null===e&&Ti(t),null;case 13:return $i(e,t,n);case 4:return Ia(t,t.stateNode.containerInfo),r=t.pendingProps,null===e?t.child=Pa(t,null,r,n):Oi(e,t,r,n),t.child;case 11:return r=t.type,l=t.pendingProps,zi(e,t,r,l=t.elementType===r?l:Kl(r,l),n);case 7:return Oi(e,t,t.pendingProps,n),t.child;case 8:case 12:return Oi(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,l=t.pendingProps,o=t.memoizedProps,Zl(t,a=l.value),null!==o){var u=o.value;if(0===(a=qr(u,a)?0:0|("function"==typeof r._calculateChangedBits?r._calculateChangedBits(u,a):1073741823))){if(o.children===l.children&&!fl.current){t=Ki(e,t,n);break e}}else for(null!==(u=t.child)&&(u.return=t);null!==u;){var c=u.dependencies;if(null!==c){o=u.child;for(var s=c.firstContext;null!==s;){if(s.context===r&&0!=(s.observedBits&a)){1===u.tag&&((s=oa(n,null)).tag=2,ca(u,s)),u.expirationTime=t&&e<=t}function $u(e,t){var n=e.firstSuspendedTime,r=e.lastSuspendedTime;nt||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Hu(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Qu(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Ku(e,t,n,r,l,a){var o=t.current;e:if(n){t:{if(wt(n=n._reactInternalFiber)!==n||1!==n.tag)throw i(Error(170));var u=n;do{switch(u.tag){case 3:u=u.stateNode.context;break t;case 1:if(ml(u.type)){u=u.stateNode.__reactInternalMemoizedMergedChildContext;break t}}u=u.return}while(null!==u);throw i(Error(171))}if(1===n.tag){var c=n.type;if(ml(c)){n=yl(n,c,u);break e}}n=u}else n=cl;return null===t.context?t.context=n:t.pendingContext=n,t=a,(l=oa(r,l)).payload={element:e},null!==(t=void 0===t?null:t)&&(l.callback=t),ca(o,l),nu(o,r),r}function qu(e,t,n,r){var l=t.current,a=Jo(),i=va.suspense;return Ku(e,t,n,l=Zo(a,l,i),i,r)}function Yu(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Xu(e){var t=1073741821-25*(1+((1073741821-Jo()+500)/25|0));t<=tu&&--t,this._expirationTime=tu=t,this._root=e,this._callbacks=this._next=null,this._hasChildren=this._didComplete=!1,this._children=null,this._defer=!0}function Gu(){this._callbacks=null,this._didCommit=!1,this._onCommit=this._onCommit.bind(this)}function Ju(e,t,n){var r=new Vu(e,t,n=null!=n&&!0===n.hydrate),l=Iu(3,null,null,2===t?7:1===t?3:0);return r.current=l,l.stateNode=r,e[ir]=r.current,n&&0!==t&&function(e){var t=Nn(e);ot.forEach((function(n){On(n,e,t)})),ut.forEach((function(n){On(n,e,t)}))}(9===e.nodeType?e:e.ownerDocument),r}function Zu(e,t,n){this._internalRoot=Ju(e,t,n)}function ec(e,t){this._internalRoot=Ju(e,2,t)}function tc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function nc(e,t,n,r,l){var a=n._reactRootContainer;if(a){var i=a._internalRoot;if("function"==typeof l){var o=l;l=function(){var e=Yu(i);o.call(e)}}qu(t,i,e,l)}else{if(a=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Zu(e,0,t?{hydrate:!0}:void 0)}(n,r),i=a._internalRoot,"function"==typeof l){var u=l;l=function(){var e=Yu(i);u.call(e)}}du((function(){qu(t,i,e,l)}))}return Yu(i)}function rc(e,t){var n=2=t;)n=r,r=r._next;e._next=r,null!==n&&(n._next=e)}return e},ie=su,oe=fu,ue=uu,ce=function(e,t){var n=Po;Po|=2;try{return e(t)}finally{(Po=n)===go&&Hl()}};var lc,ac,ic={createPortal:rc,findDOMNode:function(e){if(null==e)e=null;else if(1!==e.nodeType){var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw i(Error(188));throw i(Error(268),Object.keys(e))}e=null===(e=kt(t))?null:e.stateNode}return e},hydrate:function(e,t,n){if(!tc(t))throw i(Error(200));return nc(null,e,t,!0,n)},render:function(e,t,n){if(!tc(t))throw i(Error(200));return nc(null,e,t,!1,n)},unstable_renderSubtreeIntoContainer:function(e,t,n,r){if(!tc(n))throw i(Error(200));if(null==e||void 0===e._reactInternalFiber)throw i(Error(38));return nc(e,t,n,!1,r)},unmountComponentAtNode:function(e){if(!tc(e))throw i(Error(40));return!!e._reactRootContainer&&(du((function(){nc(null,null,e,!1,(function(){e._reactRootContainer=null}))})),!0)},unstable_createPortal:function(){return rc.apply(void 0,arguments)},unstable_batchedUpdates:su,unstable_interactiveUpdates:function(e,t,n,r){return uu(),fu(e,t,n,r)},unstable_discreteUpdates:fu,unstable_flushDiscreteUpdates:uu,flushSync:function(e,t){if((Po&(bo|wo))!==go)throw i(Error(187));var n=Po;Po|=1;try{return Vl(99,e.bind(null,t))}finally{Po=n,Hl()}},unstable_createRoot:function(e,t){if(!tc(e))throw i(Error(299),"unstable_createRoot");return new ec(e,t)},unstable_createSyncRoot:function(e,t){if(!tc(e))throw i(Error(299),"unstable_createRoot");return new Zu(e,1,t)},unstable_flushControlled:function(e){var t=Po;Po|=1;try{Vl(99,e)}finally{(Po=t)===go&&Hl()}},__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{Events:[ur,cr,sr,z.injectEventPluginsByName,d,Nt,function(e){C(e,Pt)},le,ae,Sn,O,_u,{current:!1}]}};ac=(lc={findFiberByHostInstance:or,bundleType:0,version:"16.10.2",rendererPackageName:"react-dom"}).findFiberByHostInstance,function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);Uu=function(e){try{t.onCommitFiberRoot(n,e,void 0,64==(64&e.current.effectTag))}catch(e){}},Mu=function(e){try{t.onCommitFiberUnmount(n,e)}catch(e){}}}catch(e){}}(l({},lc,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:M.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=kt(e))?null:e.stateNode},findFiberByHostInstance:function(e){return ac?ac(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}));var oc={default:ic},uc=oc&&ic||oc;e.exports=uc.default||uc},103:function(e,t,n){"use strict";e.exports=n(104)},104:function(e,t,n){"use strict";
-/** @license React v0.16.2
- * scheduler.production.min.js
- *
- * Copyright (c) Facebook, Inc. and its affiliates.
- *
- * This source code is licensed under the MIT license found in the
- * LICENSE file in the root directory of this source tree.
- */var r,l,a,i,o;if(Object.defineProperty(t,"__esModule",{value:!0}),"undefined"==typeof window||"function"!=typeof MessageChannel){var u=null,c=null,s=function(){if(null!==u)try{var e=t.unstable_now();u(!0,e),u=null}catch(e){throw setTimeout(s,0),e}},f=Date.now();t.unstable_now=function(){return Date.now()-f},r=function(e){null!==u?setTimeout(r,0,e):(u=e,setTimeout(s,0))},l=function(e,t){c=setTimeout(e,t)},a=function(){clearTimeout(c)},i=function(){return!1},o=t.unstable_forceFrameRate=function(){}}else{var d=window.performance,p=window.Date,m=window.setTimeout,h=window.clearTimeout,v=window.requestAnimationFrame,g=window.cancelAnimationFrame;if("undefined"!=typeof console&&("function"!=typeof v&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof g&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")),"object"==typeof d&&"function"==typeof d.now)t.unstable_now=function(){return d.now()};else{var y=p.now();t.unstable_now=function(){return p.now()-y}}var b=!1,w=null,E=-1,k=5,x=0;i=function(){return t.unstable_now()>=x},o=function(){},t.unstable_forceFrameRate=function(e){0>e||125N(i,n))void 0!==u&&0>N(u,i)?(e[r]=u,e[o]=n,r=o):(e[r]=i,e[a]=n,r=a);else{if(!(void 0!==u&&0>N(u,n)))break e;e[r]=u,e[o]=n,r=o}}}return t}return null}function N(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var O=[],z=[],U=1,M=null,R=3,I=!1,F=!1,D=!1;function L(e){for(var t=C(z);null!==t;){if(null===t.callback)P(z);else{if(!(t.startTime<=e))break;P(z),t.sortIndex=t.expirationTime,_(O,t)}t=C(z)}}function j(e){if(D=!1,L(e),!F)if(null!==C(O))F=!0,r(A);else{var t=C(z);null!==t&&l(j,t.startTime-e)}}function A(e,n){F=!1,D&&(D=!1,a()),I=!0;var r=R;try{for(L(n),M=C(O);null!==M&&(!(M.expirationTime>n)||e&&!i());){var o=M.callback;if(null!==o){M.callback=null,R=M.priorityLevel;var u=o(M.expirationTime<=n);n=t.unstable_now(),"function"==typeof u?M.callback=u:M===C(O)&&P(O),L(n)}else P(O);M=C(O)}if(null!==M)var c=!0;else{var s=C(z);null!==s&&l(j,s.startTime-n),c=!1}return c}finally{M=null,R=r,I=!1}}function B(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var V=o;t.unstable_ImmediatePriority=1,t.unstable_UserBlockingPriority=2,t.unstable_NormalPriority=3,t.unstable_IdlePriority=5,t.unstable_LowPriority=4,t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=R;R=e;try{return t()}finally{R=n}},t.unstable_next=function(e){switch(R){case 1:case 2:case 3:var t=3;break;default:t=R}var n=R;R=t;try{return e()}finally{R=n}},t.unstable_scheduleCallback=function(e,n,i){var o=t.unstable_now();if("object"==typeof i&&null!==i){var u=i.delay;u="number"==typeof u&&0o?(e.sortIndex=u,_(z,e),null===C(O)&&e===C(z)&&(D?a():D=!0,l(j,u-o))):(e.sortIndex=i,_(O,e),F||I||(F=!0,r(A))),e},t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_wrapCallback=function(e){var t=R;return function(){var n=R;R=t;try{return e.apply(this,arguments)}finally{R=n}}},t.unstable_getCurrentPriorityLevel=function(){return R},t.unstable_shouldYield=function(){var e=t.unstable_now();L(e);var n=C(O);return n!==M&&null!==M&&null!==n&&null!==n.callback&&n.startTime<=e&&n.expirationTime=r&&e.section_support_tier=100})).map((function(t,n){return l.a.createElement("li",{key:n},l.a.createElement("a",{href:e.baseUrlStore+"/u/"+t.username},l.a.createElement("img",{src:t.profile_image_url})))}));n=l.a.createElement("ul",null,s);var d=e.baseUrlStore+"/support-predefined?section_id="+e.section.section_id;return d=d+"&amount_predefined="+i,t=l.a.createElement("div",{className:"tier-container"},n&&l.a.createElement("span",null,s.length," Supporters "),l.a.createElement("div",{className:"join"},l.a.createElement("div",null,"$",l.a.createElement("input",{className:"free-amount",onChange:function(e){o(e.target.value)}}),l.a.createElement("span",null,"100 or more")),l.a.createElement("div",null,l.a.createElement("a",{href:d,id:"free-amount-link"},"Join ")))),l.a.createElement("div",{className:"support-container"},l.a.createElement("div",{className:"tiers"},l.a.createElement("h5",null,"Tiers")),c,t)};function p(e,t,n){for(var r=0;rhandleClick(section)}\n\n if (sections) {\n var t = sections.map(function (s, index) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: s.section_id,\n className: section && section.section_id == s.section_id ? 'active' : ''\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: \"/supporters?id=\" + s.section_id\n }, s.name));\n });\n sectioncontainer = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"pling-nav-tabs\",\n style: {\n 'display': 'flex'\n }\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"nav nav-tabs pling-section-tabs\"\n }, t));\n }\n\n var categories;\n\n if (details && section) {\n categories = details.map(function (detail, index) {\n if (detail.section_id == section.section_id) return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: index\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n onClick: function onClick() {\n return onClickCategory(detail);\n }\n }, detail.title));\n });\n }\n\n var detailContent;\n\n if (showContent == 'supporters') {\n detailContent = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_Supporters__WEBPACK_IMPORTED_MODULE_4__[\"default\"], {\n baseUrlStore: state.baseurlStore,\n supporters: supporters\n });\n } else if (showContent == 'recentplings') {\n detailContent = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_RecentPlinged__WEBPACK_IMPORTED_MODULE_6__[\"default\"], {\n products: recentplings,\n baseUrlStore: state.baseurlStore\n });\n } else if (showContent == 'overview-category-subcat') {\n detailContent = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TopCreators__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n creators: creatorsCategory,\n baseUrlStore: state.baseurlStore\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TopProducts__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n products: productsCategory,\n baseUrlStore: state.baseurlStore\n }));\n } else {\n // overview or category all on click\n detailContent = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TopCreators__WEBPACK_IMPORTED_MODULE_2__[\"default\"], {\n creators: creators,\n baseUrlStore: state.baseurlStore\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TopProducts__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n products: products,\n baseUrlStore: state.baseurlStore\n }));\n }\n\n sectiondetail = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"pling-section-detail\"\n }, section && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"pling-section-detail-left\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h2\", {\n className: showContent == 'supporters' ? 'focused' : ''\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n onClick: function onClick() {\n return showDetail('supporters');\n }\n }, \"Supporters\")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h2\", {\n className: showContent == 'overview-category' || showContent == 'overview-category-subcat' ? 'focused' : ''\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n onClick: function onClick() {\n return showDetail('overview-category');\n }\n }, \"Plings\")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", {\n className: \"pling-section-detail-ul\"\n }, categories), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h2\", {\n className: showContent == 'recentplings' ? 'focused' : ''\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n onClick: function onClick() {\n return showDetail('recentplings');\n }\n }, \"Recent Plings\"))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"pling-section-detail-middle\"\n }, detailContent), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"pling-section-detail-right\"\n }, section && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"btnSupporter\"\n }, \"Become a Supporter\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_Support__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n baseUrlStore: state.baseurlStore,\n section: section,\n supporters: supporters\n }))));\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(react__WEBPACK_IMPORTED_MODULE_0___default.a.Fragment, null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_Header__WEBPACK_IMPORTED_MODULE_5__[\"default\"], {\n supporters: supporters,\n section: section\n }), sectioncontainer, sectiondetail);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AppSupporters);\n\n//# sourceURL=webpack:///./app-supporters/components/AppSupporters.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/Creator.js":
+/*!**********************************************!*\
+ !*** ./app-supporters/components/Creator.js ***!
+ \**********************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\n\nfunction Creator(props) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"creatorrow row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-lg-2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: props.baseUrlStore + '/u/' + props.creator.username\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"figure\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n className: \"productimg\",\n src: props.creator.profile_image_url\n })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-lg-6 userinfo\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"userinfo-title\"\n }, props.creator.username)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-lg-4\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n style: {\n width: '15px',\n height: '15px',\n \"float\": 'left',\n marginRight: '2px'\n },\n src: props.baseUrlStore + '/images/system/pling-btn-active.png'\n }), props.creator.cnt, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"colorGrey\"\n }, ' (' + props.creator.sum_plings_all + ')'))));\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Creator);\n\n//# sourceURL=webpack:///./app-supporters/components/Creator.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/Header.js":
+/*!*********************************************!*\
+ !*** ./app-supporters/components/Header.js ***!
+ \*********************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./app-supporters/components/util.js\");\n\n\n\nvar Header = function Header(props) {\n var s = props.supporters.filter(_util__WEBPACK_IMPORTED_MODULE_1__[\"filterDuplicated\"]).length;\n var goal = Math.ceil(s / 50) * 50;\n\n if (goal == 0) {\n goal = 50;\n }\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"pling-section-header\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"header-title\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, props.section ? props.section.name : '')), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"score-container\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \"Goal:\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"score-bar-container\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"score-bar\",\n style: {\n \"width\": s / goal * 100 + \"%\"\n }\n }, s)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, goal)));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Header);\n\n//# sourceURL=webpack:///./app-supporters/components/Header.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/Product.js":
+/*!**********************************************!*\
+ !*** ./app-supporters/components/Product.js ***!
+ \**********************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar Product = function Product(props) {\n var projectUrl = props.baseUrlStore + \"/p/\" + props.product.project_id;\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"productrow row\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-lg-2\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: projectUrl\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"figure\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n className: \"productimg\",\n src: props.product.image_small\n })))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-lg-6\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"product-info\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"product-info-title\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: projectUrl\n }, props.product.title)), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"product-info-category\",\n style: {\n color: '#ccc'\n }\n }, props.product.catTitle))), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"col-lg-4\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n style: {\n width: '15px',\n height: '15px',\n \"float\": 'left',\n marginRight: '2px'\n },\n src: props.baseUrlStore + '/images/system/pling-btn-active.png'\n }), props.product.sum_plings, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"colorGrey\"\n }, props.product.sum_plings_all ? ' (' + props.product.sum_plings_all + ') ' : '')));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Product);\n\n//# sourceURL=webpack:///./app-supporters/components/Product.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/RecentPlinged.js":
+/*!****************************************************!*\
+ !*** ./app-supporters/components/RecentPlinged.js ***!
+ \****************************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _RecentPlingedProduct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RecentPlingedProduct */ \"./app-supporters/components/RecentPlingedProduct.js\");\n\n\n\nvar RecentPlinged = function RecentPlinged(props) {\n Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useEffect\"])(function () {\n TooltipUserPlings.setup(\"tooltipuserplings\", \"right\");\n TooltipUser.setup('tooltipuser', 'right');\n }, [props.products]);\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n id: \"recentplinged-list\"\n }, props.products.map(function (product, index) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_RecentPlingedProduct__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n key: index,\n product: product,\n baseUrlStore: props.baseUrlStore\n });\n }));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RecentPlinged);\n\n//# sourceURL=webpack:///./app-supporters/components/RecentPlinged.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/RecentPlingedProduct.js":
+/*!***********************************************************!*\
+ !*** ./app-supporters/components/RecentPlingedProduct.js ***!
+ \***********************************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar RecentPlingedProduct = function RecentPlingedProduct(props) {\n var projectUrl = props.baseUrlStore + \"/p/\" + props.product.project_id;\n var memberUrl = props.baseUrlStore + \"/u/\" + props.product.username;\n var cStyle = {\n backgroundImage: 'url(' + props.product.image_small + ')',\n backgroundRepeat: 'no-repeat',\n backgroundSize: '115px'\n };\n var stylePlaceholder = {\n position: 'absolute',\n top: '0px',\n cursor: 'pointer',\n width: '100%',\n height: '50px'\n };\n\n var handleOnClick = function handleOnClick() {\n window.location.href = projectUrl;\n };\n\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"product-wrap\",\n style: cStyle\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n style: stylePlaceholder,\n onClick: handleOnClick\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h3\", null, props.product.title), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h3\", {\n style: {\n color: '#ccc',\n fontSize: 'small'\n }\n }, props.product.catTitle), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n className: \"small\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n className: \"tooltipuserplings\",\n \"data-tooltip-content\": \"#tooltip_content\",\n \"data-user\": props.product.project_id\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n style: {\n width: '15px',\n height: '15px',\n \"float\": 'left'\n },\n src: props.baseUrlStore + '/images/system/pling-btn-active.png'\n })), props.product.sum_plings, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", {\n style: {\n color: 'ccc'\n }\n }, props.product.sum_plings_all ? '[' + props.product.sum_plings_all + ']' : '')));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (RecentPlingedProduct);\n\n//# sourceURL=webpack:///./app-supporters/components/RecentPlingedProduct.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/Support.js":
+/*!**********************************************!*\
+ !*** ./app-supporters/components/Support.js ***!
+ \**********************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance\"); }\n\nfunction _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === \"[object Arguments]\")) { return; } var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\nvar Support = function Support(props) {\n var _useState = Object(react__WEBPACK_IMPORTED_MODULE_0__[\"useState\"])(),\n _useState2 = _slicedToArray(_useState, 2),\n typed = _useState2[0],\n setTyped = _useState2[1];\n\n var tiers = [0.99, 2, 5, 10, 20, 50];\n var limits = [2, 5, 10, 20, 50, 100];\n\n var onChangeFreeamount = function onChangeFreeamount(event) {\n setTyped(event.target.value);\n };\n\n var container = tiers.map(function (t, index) {\n var c;\n var tmp = t;\n var left, right;\n\n if (index == 0) {\n left = 0;\n } else {\n left = limits[index - 1];\n }\n\n right = limits[index];\n var result = props.supporters.filter(function (s) {\n return s.section_support_tier >= left && s.section_support_tier < right;\n });\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"tier-container\",\n key: index\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, result.length + ' Supporters'), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"join\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: url\n }, \"Join $\", t, \" Tier\")));\n });\n var result = props.supporters.filter(function (s) {\n return s.section_support_tier >= 100;\n });\n var othertiers;\n var o;\n var x = result.map(function (s, index) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: index\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: props.baseUrlStore + '/u/' + s.username\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: s.profile_image_url\n })));\n });\n o = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", null, x);\n var url = props.baseUrlStore + '/support-predefined?section_id=' + props.section.section_id;\n url = url + '&amount_predefined=' + typed;\n othertiers = react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"tier-container\"\n }, o && react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, x.length, \" Supporters \"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"join\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, \"$\", react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", {\n className: \"free-amount\",\n onChange: onChangeFreeamount\n }), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null, \"100 or more\")), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: url,\n id: \"free-amount-link\"\n }, \"Join \"))));\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"support-container\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"tiers\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h5\", null, \"Tiers\")), container, othertiers);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Support);\n\n//# sourceURL=webpack:///./app-supporters/components/Support.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/Supporters.js":
+/*!*************************************************!*\
+ !*** ./app-supporters/components/Supporters.js ***!
+ \*************************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./app-supporters/components/util.js\");\n\n\n\nvar Supporters = function Supporters(props) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"supporters-container\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", null, props.supporters.filter(_util__WEBPACK_IMPORTED_MODULE_1__[\"filterDuplicated\"]).map(function (s, index) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: index\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"a\", {\n href: props.baseUrlStore + '/u/' + s.username\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"img\", {\n src: s.profile_image_url\n })), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"username\"\n }, s.username));\n })));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Supporters);\n\n//# sourceURL=webpack:///./app-supporters/components/Supporters.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/TopCreators.js":
+/*!**************************************************!*\
+ !*** ./app-supporters/components/TopCreators.js ***!
+ \**************************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Creator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Creator */ \"./app-supporters/components/Creator.js\");\n\n\n\nvar TopCreators = function TopCreators(props) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panelContainer\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"title\"\n }, \"Most Plinged Creators\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", null, props.creators.map(function (creator, index) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: index\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_Creator__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n creator: creator,\n baseUrlStore: props.baseUrlStore,\n isAdmin: props.isAdmin\n }));\n })));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TopCreators);\n\n//# sourceURL=webpack:///./app-supporters/components/TopCreators.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/TopProducts.js":
+/*!**************************************************!*\
+ !*** ./app-supporters/components/TopProducts.js ***!
+ \**************************************************/
+/*! exports provided: default */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Product__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Product */ \"./app-supporters/components/Product.js\");\n\n\n\nvar TopProducts = function TopProducts(props) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"panelContainer\"\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", {\n className: \"title\"\n }, \"Most Plinged Products\"), react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", null, props.products.map(function (product, index) {\n return react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", {\n key: index\n }, react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_Product__WEBPACK_IMPORTED_MODULE_1__[\"default\"], {\n product: product,\n baseUrlStore: props.baseUrlStore\n }));\n })));\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TopProducts);\n\n//# sourceURL=webpack:///./app-supporters/components/TopProducts.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/components/util.js":
+/*!*******************************************!*\
+ !*** ./app-supporters/components/util.js ***!
+ \*******************************************/
+/*! exports provided: filterDuplicated */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterDuplicated\", function() { return filterDuplicated; });\nfunction filterDuplicated(el, idx, array) {\n for (var i = 0; i < array.length; i++) {\n if (array[i].member_id == el.member_id) {\n if (idx == i) {\n return el;\n } else {\n break;\n }\n }\n }\n}\n\n//# sourceURL=webpack:///./app-supporters/components/util.js?");
+
+/***/ }),
+
+/***/ "./app-supporters/entry-app-supporters.js":
+/*!************************************************!*\
+ !*** ./app-supporters/entry-app-supporters.js ***!
+ \************************************************/
+/*! no exports provided */
+/***/ (function(module, __webpack_exports__, __webpack_require__) {
+
+"use strict";
+eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _components_AppSupporters__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/AppSupporters */ \"./app-supporters/components/AppSupporters.js\");\n\n\n\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_AppSupporters__WEBPACK_IMPORTED_MODULE_2__[\"default\"], null), document.getElementById('pling-section-content'));\n\n//# sourceURL=webpack:///./app-supporters/entry-app-supporters.js?");
+
+/***/ }),
+
+/***/ "./node_modules/object-assign/index.js":
+/*!*********************************************!*\
+ !*** ./node_modules/object-assign/index.js ***!
+ \*********************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n//# sourceURL=webpack:///./node_modules/object-assign/index.js?");
+
+/***/ }),
+
+/***/ "./node_modules/prop-types/checkPropTypes.js":
+/*!***************************************************!*\
+ !*** ./node_modules/prop-types/checkPropTypes.js ***!
+ \***************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar printWarning = function() {};\n\nif (true) {\n var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\n var loggedTypeFailures = {};\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (true) {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (true) {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/checkPropTypes.js?");
+
+/***/ }),
+
+/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***!
+ \*************************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js?");
+
+/***/ }),
+
+/***/ "./node_modules/react-dom/cjs/react-dom.development.js":
+/*!*************************************************************!*\
+ !*** ./node_modules/react-dom/cjs/react-dom.development.js ***!
+ \*************************************************************/
+/*! no static exports found */
+/***/ (function(module, exports, __webpack_require__) {
+
+"use strict";
+eval("/** @license React v16.10.2\n * react-dom.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\n\n\nif (true) {\n (function() {\n'use strict';\n\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar _assign = __webpack_require__(/*! object-assign */ \"./node_modules/object-assign/index.js\");\nvar Scheduler = __webpack_require__(/*! scheduler */ \"./node_modules/scheduler/index.js\");\nvar checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ \"./node_modules/prop-types/checkPropTypes.js\");\nvar tracing = __webpack_require__(/*! scheduler/tracing */ \"./node_modules/scheduler/tracing.js\");\n\n// Do not require this module directly! Use normal `invariant` calls with\n// template literal strings. The messages will be converted to ReactError during\n// build, and in production they will be minified.\n\n// Do not require this module directly! Use normal `invariant` calls with\n// template literal strings. The messages will be converted to ReactError during\n// build, and in production they will be minified.\nfunction ReactError(error) {\n error.name = 'Invariant Violation';\n return error;\n}\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\n(function () {\n if (!React) {\n {\n throw ReactError(Error(\"ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.\"));\n }\n }\n})();\n\n/**\n * Injectable ordering of event plugins.\n */\nvar eventPluginOrder = null;\n/**\n * Injectable mapping from names to event plugin modules.\n */\n\nvar namesToPlugins = {};\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\n\nfunction recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\"));\n }\n }\n })();\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\"));\n }\n }\n })();\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\"));\n }\n }\n })();\n }\n }\n}\n/**\n * Publishes an event so that it can be dispatched by the supplied plugin.\n *\n * @param {object} dispatchConfig Dispatch configuration for the event.\n * @param {object} PluginModule Plugin publishing the event.\n * @return {boolean} True if the event was successfully published.\n * @private\n */\n\n\nfunction publishEventForPlugin(dispatchConfig, pluginModule, eventName) {\n (function () {\n if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {\n {\n throw ReactError(Error(\"EventPluginHub: More than one plugin attempted to publish the same event name, `\" + eventName + \"`.\"));\n }\n }\n })();\n\n eventNameDispatchConfigs[eventName] = dispatchConfig;\n var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n\n if (phasedRegistrationNames) {\n for (var phaseName in phasedRegistrationNames) {\n if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\n var phasedRegistrationName = phasedRegistrationNames[phaseName];\n publishRegistrationName(phasedRegistrationName, pluginModule, eventName);\n }\n }\n\n return true;\n } else if (dispatchConfig.registrationName) {\n publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);\n return true;\n }\n\n return false;\n}\n/**\n * Publishes a registration name that is used to identify dispatched events.\n *\n * @param {string} registrationName Registration name to add.\n * @param {object} PluginModule Plugin publishing the event.\n * @private\n */\n\n\nfunction publishRegistrationName(registrationName, pluginModule, eventName) {\n (function () {\n if (!!registrationNameModules[registrationName]) {\n {\n throw ReactError(Error(\"EventPluginHub: More than one plugin attempted to publish the same registration name, `\" + registrationName + \"`.\"));\n }\n }\n })();\n\n registrationNameModules[registrationName] = pluginModule;\n registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;\n\n {\n var lowerCasedName = registrationName.toLowerCase();\n possibleRegistrationNames[lowerCasedName] = registrationName;\n\n if (registrationName === 'onDoubleClick') {\n possibleRegistrationNames.ondblclick = registrationName;\n }\n }\n}\n/**\n * Registers plugins so that they can extract and dispatch events.\n *\n * @see {EventPluginHub}\n */\n\n/**\n * Ordered list of injected plugins.\n */\n\n\nvar plugins = [];\n/**\n * Mapping from event name to dispatch config\n */\n\nvar eventNameDispatchConfigs = {};\n/**\n * Mapping from registration name to plugin module\n */\n\nvar registrationNameModules = {};\n/**\n * Mapping from registration name to event name\n */\n\nvar registrationNameDependencies = {};\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\n\nvar possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true\n\n/**\n * Injects an ordering of plugins (by plugin name). This allows the ordering\n * to be decoupled from injection of the actual plugins so that ordering is\n * always deterministic regardless of packaging, on-the-fly injection, etc.\n *\n * @param {array} InjectedEventPluginOrder\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginOrder}\n */\n\nfunction injectEventPluginOrder(injectedEventPluginOrder) {\n (function () {\n if (!!eventPluginOrder) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.\"));\n }\n }\n })(); // Clone the ordering so it cannot be dynamically mutated.\n\n\n eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\n recomputePluginOrdering();\n}\n/**\n * Injects plugins to be used by `EventPluginHub`. The plugin names must be\n * in the ordering injected by `injectEventPluginOrder`.\n *\n * Plugins can be injected as part of page initialization or on-the-fly.\n *\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginsByName}\n */\n\nfunction injectEventPluginsByName(injectedNamesToPlugins) {\n var isOrderingDirty = false;\n\n for (var pluginName in injectedNamesToPlugins) {\n if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {\n continue;\n }\n\n var pluginModule = injectedNamesToPlugins[pluginName];\n\n if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {\n (function () {\n if (!!namesToPlugins[pluginName]) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject two different event plugins using the same name, `\" + pluginName + \"`.\"));\n }\n }\n })();\n\n namesToPlugins[pluginName] = pluginModule;\n isOrderingDirty = true;\n }\n }\n\n if (isOrderingDirty) {\n recomputePluginOrdering();\n }\n}\n\nvar invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n try {\n func.apply(context, funcArgs);\n } catch (error) {\n this.onError(error);\n }\n};\n\n{\n // In DEV mode, we swap out invokeGuardedCallback for a special version\n // that plays more nicely with the browser's DevTools. The idea is to preserve\n // \"Pause on exceptions\" behavior. Because React wraps all user-provided\n // functions in invokeGuardedCallback, and the production version of\n // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n // like caught exceptions, and the DevTools won't pause unless the developer\n // takes the extra step of enabling pause on caught exceptions. This is\n // unintuitive, though, because even though React has caught the error, from\n // the developer's perspective, the error is uncaught.\n //\n // To preserve the expected \"Pause on exceptions\" behavior, we don't use a\n // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n // DOM node, and call the user-provided callback from inside an event handler\n // for that fake event. If the callback throws, the error is \"captured\" using\n // a global event handler. But because the error happens in a different\n // event loop context, it does not interrupt the normal program flow.\n // Effectively, this gives us try-catch behavior without actually using\n // try-catch. Neat!\n // Check that the browser supports the APIs we need to implement our special\n // DEV version of invokeGuardedCallback\n if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n var fakeNode = document.createElement('react');\n\n var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {\n // If document doesn't exist we know for sure we will crash in this method\n // when we call document.createEvent(). However this can cause confusing\n // errors: https://github.com/facebookincubator/create-react-app/issues/3482\n // So we preemptively throw with a better message instead.\n (function () {\n if (!(typeof document !== 'undefined')) {\n {\n throw ReactError(Error(\"The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.\"));\n }\n }\n })();\n\n var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We\n // set this to true at the beginning, then set it to false right after\n // calling the function. If the function errors, `didError` will never be\n // set to false. This strategy works even if the browser is flaky and\n // fails to call our global error handler, because it doesn't rely on\n // the error event at all.\n\n var didError = true; // Keeps track of the value of window.event so that we can reset it\n // during the callback to let user code access window.event in the\n // browsers that support it.\n\n var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event\n // dispatching: https://github.com/facebook/react/issues/13688\n\n var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously\n // dispatch our fake event using `dispatchEvent`. Inside the handler, we\n // call the user-provided callback.\n\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n function callCallback() {\n // We immediately remove the callback from event listeners so that\n // nested `invokeGuardedCallback` calls do not clash. Otherwise, a\n // nested call would trigger the fake event handlers of any call higher\n // in the stack.\n fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the\n // window.event assignment in both IE <= 10 as they throw an error\n // \"Member not found\" in strict mode, and in Firefox which does not\n // support window.event.\n\n if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {\n window.event = windowEvent;\n }\n\n func.apply(context, funcArgs);\n didError = false;\n } // Create a global error event handler. We use this to capture the value\n // that was thrown. It's possible that this error handler will fire more\n // than once; for example, if non-React code also calls `dispatchEvent`\n // and a handler for that event throws. We should be resilient to most of\n // those cases. Even if our error event handler fires more than once, the\n // last error event is always used. If the callback actually does error,\n // we know that the last error event is the correct one, because it's not\n // possible for anything else to have happened in between our callback\n // erroring and the code that follows the `dispatchEvent` call below. If\n // the callback doesn't error, but the error event was fired, we know to\n // ignore it because `didError` will be false, as described above.\n\n\n var error; // Use this to track whether the error event is ever called.\n\n var didSetError = false;\n var isCrossOriginError = false;\n\n function handleWindowError(event) {\n error = event.error;\n didSetError = true;\n\n if (error === null && event.colno === 0 && event.lineno === 0) {\n isCrossOriginError = true;\n }\n\n if (event.defaultPrevented) {\n // Some other error handler has prevented default.\n // Browsers silence the error report if this happens.\n // We'll remember this to later decide whether to log it or not.\n if (error != null && typeof error === 'object') {\n try {\n error._suppressLogging = true;\n } catch (inner) {// Ignore.\n }\n }\n }\n } // Create a fake event type.\n\n\n var evtType = \"react-\" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers\n\n window.addEventListener('error', handleWindowError);\n fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function\n // errors, it will trigger our global error handler.\n\n evt.initEvent(evtType, false, false);\n fakeNode.dispatchEvent(evt);\n\n if (windowEventDescriptor) {\n Object.defineProperty(window, 'event', windowEventDescriptor);\n }\n\n if (didError) {\n if (!didSetError) {\n // The callback errored, but the error event never fired.\n error = new Error('An error was thrown inside one of your components, but React ' + \"doesn't know what it was. This is likely due to browser \" + 'flakiness. React does its best to preserve the \"Pause on ' + 'exceptions\" behavior of the DevTools, which requires some ' + \"DEV-mode only tricks. It's possible that these don't work in \" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n } else if (isCrossOriginError) {\n error = new Error(\"A cross-origin error was thrown. React doesn't have access to \" + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');\n }\n\n this.onError(error);\n } // Remove our event listeners\n\n\n window.removeEventListener('error', handleWindowError);\n };\n\n invokeGuardedCallbackImpl = invokeGuardedCallbackDev;\n }\n}\n\nvar invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;\n\nvar hasError = false;\nvar caughtError = null; // Used by event system to capture/rethrow the first error.\n\nvar hasRethrowError = false;\nvar rethrowError = null;\nvar reporter = {\n onError: function (error) {\n hasError = true;\n caughtError = error;\n }\n};\n/**\n * Call a function while guarding against errors that happens within it.\n * Returns an error if it throws, otherwise null.\n *\n * In production, this is implemented using a try-catch. The reason we don't\n * use a try-catch directly is so that we can swap out a different\n * implementation in DEV mode.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\n hasError = false;\n caughtError = null;\n invokeGuardedCallbackImpl$1.apply(reporter, arguments);\n}\n/**\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\n * it in a global so it can be rethrown by `rethrowCaughtError` later.\n * TODO: See if caughtError and rethrowError can be unified.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {\n invokeGuardedCallback.apply(this, arguments);\n\n if (hasError) {\n var error = clearCaughtError();\n\n if (!hasRethrowError) {\n hasRethrowError = true;\n rethrowError = error;\n }\n }\n}\n/**\n * During execution of guarded functions we will capture the first error which\n * we will rethrow to be handled by the top level error handler.\n */\n\nfunction rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n}\nfunction hasCaughtError() {\n return hasError;\n}\nfunction clearCaughtError() {\n if (hasError) {\n var error = caughtError;\n hasError = false;\n caughtError = null;\n return error;\n } else {\n (function () {\n {\n {\n throw ReactError(Error(\"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.\"));\n }\n }\n })();\n }\n}\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\nvar warningWithoutStack = function () {};\n\n{\n warningWithoutStack = function (condition, format) {\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n if (format === undefined) {\n throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (args.length > 8) {\n // Check before the condition to catch violations early.\n throw new Error('warningWithoutStack() currently supports at most 8 arguments.');\n }\n\n if (condition) {\n return;\n }\n\n if (typeof console !== 'undefined') {\n var argsWithFormat = args.map(function (item) {\n return '' + item;\n });\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n\n Function.prototype.apply.call(console.error, console, argsWithFormat);\n }\n\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nvar warningWithoutStack$1 = warningWithoutStack;\n\nvar getFiberCurrentPropsFromNode = null;\nvar getInstanceFromNode = null;\nvar getNodeFromInstance = null;\nfunction setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {\n getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;\n getInstanceFromNode = getInstanceFromNodeImpl;\n getNodeFromInstance = getNodeFromInstanceImpl;\n\n {\n !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;\n }\n}\nvar validateEventDispatches;\n\n{\n validateEventDispatches = function (event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n var listenersIsArr = Array.isArray(dispatchListeners);\n var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;\n var instancesIsArr = Array.isArray(dispatchInstances);\n var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;\n !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;\n };\n}\n/**\n * Dispatch the event to the listener.\n * @param {SyntheticEvent} event SyntheticEvent to handle\n * @param {function} listener Application-level callback\n * @param {*} inst Internal component instance\n */\n\n\nfunction executeDispatch(event, listener, inst) {\n var type = event.type || 'unknown-event';\n event.currentTarget = getNodeFromInstance(inst);\n invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n event.currentTarget = null;\n}\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\n\nfunction executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}\n/**\n * @see executeDispatchesInOrderStopAtTrueImpl\n */\n\n\n\n/**\n * Execution of a \"direct\" dispatch - there must be at most one dispatch\n * accumulated on the event or it is considered an error. It doesn't really make\n * sense for an event with multiple dispatches (bubbled) to keep track of the\n * return values at each dispatch execution, but it does tend to make sense when\n * dealing with \"direct\" dispatches.\n *\n * @return {*} The return value of executing the single dispatch.\n */\n\n\n/**\n * @param {SyntheticEvent} event\n * @return {boolean} True iff number of dispatches accumulated is greater than 0.\n */\n\n/**\n * Accumulates items that must not be null or undefined into the first one. This\n * is used to conserve memory by avoiding array allocations, and thus sacrifices\n * API cleanness. Since `current` can be null before being passed in and not\n * null after this function, make sure to assign it back to `current`:\n *\n * `a = accumulateInto(a, b);`\n *\n * This API should be sparingly used. Try `accumulate` for something cleaner.\n *\n * @return {*|array<*>} An accumulation of items.\n */\n\nfunction accumulateInto(current, next) {\n (function () {\n if (!(next != null)) {\n {\n throw ReactError(Error(\"accumulateInto(...): Accumulated items must not be null or undefined.\"));\n }\n }\n })();\n\n if (current == null) {\n return next;\n } // Both are not empty. Warning: Never call x.concat(y) when you are not\n // certain that x is an Array (x could be a string with concat method).\n\n\n if (Array.isArray(current)) {\n if (Array.isArray(next)) {\n current.push.apply(current, next);\n return current;\n }\n\n current.push(next);\n return current;\n }\n\n if (Array.isArray(next)) {\n // A bit too dangerous to mutate `next`.\n return [current].concat(next);\n }\n\n return [current, next];\n}\n\n/**\n * @param {array} arr an \"accumulation\" of items which is either an Array or\n * a single item. Useful when paired with the `accumulate` module. This is a\n * simple utility that allows us to reason about a collection of items, but\n * handling the case when there is exactly one item (and we do not need to\n * allocate an array).\n * @param {function} cb Callback invoked with each element or a collection.\n * @param {?} [scope] Scope used as `this` in a callback.\n */\nfunction forEachAccumulated(arr, cb, scope) {\n if (Array.isArray(arr)) {\n arr.forEach(cb, scope);\n } else if (arr) {\n cb.call(scope, arr);\n }\n}\n\n/**\n * Internal queue of events that have accumulated their dispatches and are\n * waiting to have their dispatches executed.\n */\n\nvar eventQueue = null;\n/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @private\n */\n\nvar executeDispatchesAndRelease = function (event) {\n if (event) {\n executeDispatchesInOrder(event);\n\n if (!event.isPersistent()) {\n event.constructor.release(event);\n }\n }\n};\n\nvar executeDispatchesAndReleaseTopLevel = function (e) {\n return executeDispatchesAndRelease(e);\n};\n\nfunction runEventsInBatch(events) {\n if (events !== null) {\n eventQueue = accumulateInto(eventQueue, events);\n } // Set `eventQueue` to null before processing it so that we can tell if more\n // events get enqueued while processing.\n\n\n var processingEventQueue = eventQueue;\n eventQueue = null;\n\n if (!processingEventQueue) {\n return;\n }\n\n forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);\n\n (function () {\n if (!!eventQueue) {\n {\n throw ReactError(Error(\"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.\"));\n }\n }\n })(); // This would be a good time to rethrow if any of the event handlers threw.\n\n\n rethrowCaughtError();\n}\n\nfunction isInteractive(tag) {\n return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\n\nfunction shouldPreventMouseEvent(name, type, props) {\n switch (name) {\n case 'onClick':\n case 'onClickCapture':\n case 'onDoubleClick':\n case 'onDoubleClickCapture':\n case 'onMouseDown':\n case 'onMouseDownCapture':\n case 'onMouseMove':\n case 'onMouseMoveCapture':\n case 'onMouseUp':\n case 'onMouseUpCapture':\n return !!(props.disabled && isInteractive(type));\n\n default:\n return false;\n }\n}\n/**\n * This is a unified interface for event plugins to be installed and configured.\n *\n * Event plugins can implement the following properties:\n *\n * `extractEvents` {function(string, DOMEventTarget, string, object): *}\n * Required. When a top-level event is fired, this method is expected to\n * extract synthetic events that will in turn be queued and dispatched.\n *\n * `eventTypes` {object}\n * Optional, plugins that fire events must publish a mapping of registration\n * names that are used to register listeners. Values of this mapping must\n * be objects that contain `registrationName` or `phasedRegistrationNames`.\n *\n * `executeDispatch` {function(object, function, string)}\n * Optional, allows plugins to override how an event gets dispatched. By\n * default, the listener is simply invoked.\n *\n * Each plugin that is injected into `EventsPluginHub` is immediately operable.\n *\n * @public\n */\n\n/**\n * Methods for injecting dependencies.\n */\n\n\nvar injection = {\n /**\n * @param {array} InjectedEventPluginOrder\n * @public\n */\n injectEventPluginOrder: injectEventPluginOrder,\n\n /**\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n */\n injectEventPluginsByName: injectEventPluginsByName\n};\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n */\n\nfunction getListener(inst, registrationName) {\n var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not\n // live here; needs to be moved to a better place soon\n\n var stateNode = inst.stateNode;\n\n if (!stateNode) {\n // Work in progress (ex: onload events in incremental mode).\n return null;\n }\n\n var props = getFiberCurrentPropsFromNode(stateNode);\n\n if (!props) {\n // Work in progress.\n return null;\n }\n\n listener = props[registrationName];\n\n if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n return null;\n }\n\n (function () {\n if (!(!listener || typeof listener === 'function')) {\n {\n throw ReactError(Error(\"Expected `\" + registrationName + \"` listener to be a function, instead got a value of `\" + typeof listener + \"` type.\"));\n }\n }\n })();\n\n return listener;\n}\n/**\n * Allows registered plugins an opportunity to extract events from top-level\n * native browser events.\n *\n * @return {*} An accumulation of synthetic events.\n * @internal\n */\n\nfunction extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var events = null;\n\n for (var i = 0; i < plugins.length; i++) {\n // Not every plugin in the ordering may be loaded at runtime.\n var possiblePlugin = plugins[i];\n\n if (possiblePlugin) {\n var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n\n if (extractedEvents) {\n events = accumulateInto(events, extractedEvents);\n }\n }\n }\n\n return events;\n}\n\nfunction runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n runEventsInBatch(events);\n}\n\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\n\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\n\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\n\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar FundamentalComponent = 20;\nvar ScopeComponent = 21;\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.\n// Current owner and dispatcher used to share the same ref,\n// but PR #14548 split them out to better support the react-debug-tools package.\n\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {\n ReactSharedInternals.ReactCurrentDispatcher = {\n current: null\n };\n}\n\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {\n ReactSharedInternals.ReactCurrentBatchConfig = {\n suspense: null\n };\n}\n\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\/]/;\nvar describeComponentFrame = function (name, source, ownerName) {\n var sourceInfo = '';\n\n if (source) {\n var path = source.fileName;\n var fileName = path.replace(BEFORE_SLASH_RE, '');\n\n {\n // In DEV, include code for a common special case:\n // prefer \"folder/index.js\" instead of just \"index.js\".\n if (/^index\\./.test(fileName)) {\n var match = path.match(BEFORE_SLASH_RE);\n\n if (match) {\n var pathBeforeSlash = match[1];\n\n if (pathBeforeSlash) {\n var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n fileName = folderName + '/' + fileName;\n }\n }\n }\n }\n\n sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n } else if (ownerName) {\n sourceInfo = ' (created by ' + ownerName + ')';\n }\n\n return '\\n in ' + (name || 'Unknown') + sourceInfo;\n};\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\n\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = warningWithoutStack$1;\n\n{\n warning = function (condition, format) {\n if (condition) {\n return;\n }\n\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args\n\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));\n };\n}\n\nvar warning$1 = warning;\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\nfunction refineResolvedLazyComponent(lazyComponent) {\n return lazyComponent._status === Resolved ? lazyComponent._result : null;\n}\nfunction initializeLazyComponentType(lazyComponent) {\n if (lazyComponent._status === Uninitialized) {\n lazyComponent._status = Pending;\n var ctor = lazyComponent._ctor;\n var thenable = ctor();\n lazyComponent._result = thenable;\n thenable.then(function (moduleObject) {\n if (lazyComponent._status === Pending) {\n var defaultExport = moduleObject.default;\n\n {\n if (defaultExport === undefined) {\n warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + \"const MyComponent = lazy(() => import('./MyComponent'))\", moduleObject);\n }\n }\n\n lazyComponent._status = Resolved;\n lazyComponent._result = defaultExport;\n }\n }, function (error) {\n if (lazyComponent._status === Pending) {\n lazyComponent._status = Rejected;\n lazyComponent._result = error;\n }\n });\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getComponentName(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n return 'Context.Consumer';\n\n case REACT_PROVIDER_TYPE:\n return 'Context.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n\n case REACT_LAZY_TYPE:\n {\n var thenable = type;\n var resolvedThenable = refineResolvedLazyComponent(thenable);\n\n if (resolvedThenable) {\n return getComponentName(resolvedThenable);\n }\n\n break;\n }\n }\n }\n\n return null;\n}\n\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction describeFiber(fiber) {\n switch (fiber.tag) {\n case HostRoot:\n case HostPortal:\n case HostText:\n case Fragment:\n case ContextProvider:\n case ContextConsumer:\n return '';\n\n default:\n var owner = fiber._debugOwner;\n var source = fiber._debugSource;\n var name = getComponentName(fiber.type);\n var ownerName = null;\n\n if (owner) {\n ownerName = getComponentName(owner.type);\n }\n\n return describeComponentFrame(name, source, ownerName);\n }\n}\n\nfunction getStackByFiberInDevAndProd(workInProgress) {\n var info = '';\n var node = workInProgress;\n\n do {\n info += describeFiber(node);\n node = node.return;\n } while (node);\n\n return info;\n}\nvar current = null;\nvar phase = null;\nfunction getCurrentFiberOwnerNameInDevOrNull() {\n {\n if (current === null) {\n return null;\n }\n\n var owner = current._debugOwner;\n\n if (owner !== null && typeof owner !== 'undefined') {\n return getComponentName(owner.type);\n }\n }\n\n return null;\n}\nfunction getCurrentFiberStackInDev() {\n {\n if (current === null) {\n return '';\n } // Safe because if current fiber exists, we are reconciling,\n // and it is guaranteed to be the work-in-progress version.\n\n\n return getStackByFiberInDevAndProd(current);\n }\n\n return '';\n}\nfunction resetCurrentFiber() {\n {\n ReactDebugCurrentFrame.getCurrentStack = null;\n current = null;\n phase = null;\n }\n}\nfunction setCurrentFiber(fiber) {\n {\n ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;\n current = fiber;\n phase = null;\n }\n}\nfunction setCurrentPhase(lifeCyclePhase) {\n {\n phase = lifeCyclePhase;\n }\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n\nfunction endsWith(subject, search) {\n var length = subject.length;\n return subject.substring(length - search.length, length) === search;\n}\n\nvar PLUGIN_EVENT_SYSTEM = 1;\nvar RESPONDER_EVENT_SYSTEM = 1 << 1;\nvar IS_PASSIVE = 1 << 2;\nvar IS_ACTIVE = 1 << 3;\nvar PASSIVE_NOT_SUPPORTED = 1 << 4;\nvar IS_REPLAYED = 1 << 5;\n\nvar restoreImpl = null;\nvar restoreTarget = null;\nvar restoreQueue = null;\n\nfunction restoreStateOfTarget(target) {\n // We perform this translation at the end of the event loop so that we\n // always receive the correct fiber here\n var internalInstance = getInstanceFromNode(target);\n\n if (!internalInstance) {\n // Unmounted\n return;\n }\n\n (function () {\n if (!(typeof restoreImpl === 'function')) {\n {\n throw ReactError(Error(\"setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.\"));\n }\n }\n })();\n\n var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);\n restoreImpl(internalInstance.stateNode, internalInstance.type, props);\n}\n\nfunction setRestoreImplementation(impl) {\n restoreImpl = impl;\n}\nfunction enqueueStateRestore(target) {\n if (restoreTarget) {\n if (restoreQueue) {\n restoreQueue.push(target);\n } else {\n restoreQueue = [target];\n }\n } else {\n restoreTarget = target;\n }\n}\nfunction needsStateRestore() {\n return restoreTarget !== null || restoreQueue !== null;\n}\nfunction restoreStateIfNeeded() {\n if (!restoreTarget) {\n return;\n }\n\n var target = restoreTarget;\n var queuedTargets = restoreQueue;\n restoreTarget = null;\n restoreQueue = null;\n restoreStateOfTarget(target);\n\n if (queuedTargets) {\n for (var i = 0; i < queuedTargets.length; i++) {\n restoreStateOfTarget(queuedTargets[i]);\n }\n }\n}\n\nvar enableUserTimingAPI = true; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:\n\nvar debugRenderPhaseSideEffects = false; // In some cases, StrictMode should also double-render lifecycles.\n// This can be confusing for tests though,\n// And it can be bad for performance in production.\n// This feature flag can be used to control the behavior:\n\nvar debugRenderPhaseSideEffectsForStrictMode = true; // To preserve the \"Pause on caught exceptions\" behavior of the debugger, we\n// replay the begin phase of a failed component inside invokeGuardedCallback.\n\nvar replayFailedUnitOfWorkWithInvokeGuardedCallback = true; // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:\n\nvar warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees.\n\nvar enableProfilerTimer = true; // Trace which interactions trigger each commit.\n\nvar enableSchedulerTracing = true; // Only used in www builds.\n\nvar enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false.\n\nvar enableSelectiveHydration = false; // Only used in www builds.\n\n // Only used in www builds.\n\n // Disable javascript: URL strings in href for XSS protection.\n\nvar disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing\n// with their related DOM properties\n\nvar disableInputAttributeSyncing = false; // These APIs will no longer be \"unstable\" in the upcoming 16.7 release,\n// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.\n\nvar enableStableConcurrentModeAPIs = false;\nvar warnAboutShorthandPropertyCollision = false; // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information\n// This is a flag so we can fix warnings in RN core before turning it on\n\n // Experimental React Flare event system and event components support.\n\nvar enableFlareAPI = false; // Experimental Host Component support.\n\nvar enableFundamentalAPI = false; // Experimental Scope support.\n\nvar enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107\n\n // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)\n// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version\n\nvar warnAboutUnmockedScheduler = false; // For tests, we flush suspense fallbacks in an act scope;\n// *except* in some of our own tests, where we test incremental loading states.\n\nvar flushSuspenseFallbacksInTests = true; // Changes priority of some events like mousemove to user-blocking priority,\n// but without making them discrete. The flag exists in case it causes\n// starvation problems.\n\nvar enableUserBlockingEvents = false; // Add a callback property to suspense to notify which promises are currently\n// in the update queue. This allows reporting and tracing of what is causing\n// the user to see a loading state.\n// Also allows hydration callbacks to fire when a dehydrated boundary gets\n// hydrated or deleted.\n\nvar enableSuspenseCallback = false; // Part of the simplification of React.createElement so we can eventually move\n// from React.createElement to React.jsx\n// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md\n\nvar warnAboutDefaultPropsOnFunctionComponents = false;\nvar warnAboutStringRefs = false;\nvar disableLegacyContext = false;\nvar disableSchedulerTimeoutBasedOnReactExpirationTime = false;\nvar enableTrustedTypesIntegration = false;\n\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n// Defaults\n\nvar batchedUpdatesImpl = function (fn, bookkeeping) {\n return fn(bookkeeping);\n};\n\nvar discreteUpdatesImpl = function (fn, a, b, c) {\n return fn(a, b, c);\n};\n\nvar flushDiscreteUpdatesImpl = function () {};\n\nvar batchedEventUpdatesImpl = batchedUpdatesImpl;\nvar isInsideEventHandler = false;\nvar isBatchingEventUpdates = false;\n\nfunction finishEventHandler() {\n // Here we wait until all updates have propagated, which is important\n // when using controlled components within layers:\n // https://github.com/facebook/react/issues/1698\n // Then we restore state of any controlled component.\n var controlledComponentsHavePendingUpdates = needsStateRestore();\n\n if (controlledComponentsHavePendingUpdates) {\n // If a controlled event was fired, we may need to restore the state of\n // the DOM node back to the controlled value. This is necessary when React\n // bails out of the update without touching the DOM.\n flushDiscreteUpdatesImpl();\n restoreStateIfNeeded();\n }\n}\n\nfunction batchedUpdates(fn, bookkeeping) {\n if (isInsideEventHandler) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state.\n return fn(bookkeeping);\n }\n\n isInsideEventHandler = true;\n\n try {\n return batchedUpdatesImpl(fn, bookkeeping);\n } finally {\n isInsideEventHandler = false;\n finishEventHandler();\n }\n}\nfunction batchedEventUpdates(fn, a, b) {\n if (isBatchingEventUpdates) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state.\n return fn(a, b);\n }\n\n isBatchingEventUpdates = true;\n\n try {\n return batchedEventUpdatesImpl(fn, a, b);\n } finally {\n isBatchingEventUpdates = false;\n finishEventHandler();\n }\n} // This is for the React Flare event system\n\nfunction executeUserEventHandler(fn, value) {\n var previouslyInEventHandler = isInsideEventHandler;\n\n try {\n isInsideEventHandler = true;\n var type = typeof value === 'object' && value !== null ? value.type : '';\n invokeGuardedCallbackAndCatchFirstError(type, fn, undefined, value);\n } finally {\n isInsideEventHandler = previouslyInEventHandler;\n }\n}\nfunction discreteUpdates(fn, a, b, c) {\n var prevIsInsideEventHandler = isInsideEventHandler;\n isInsideEventHandler = true;\n\n try {\n return discreteUpdatesImpl(fn, a, b, c);\n } finally {\n isInsideEventHandler = prevIsInsideEventHandler;\n\n if (!isInsideEventHandler) {\n finishEventHandler();\n }\n }\n}\nvar lastFlushedEventTimeStamp = 0;\nfunction flushDiscreteUpdatesIfNeeded(timeStamp) {\n // event.timeStamp isn't overly reliable due to inconsistencies in\n // how different browsers have historically provided the time stamp.\n // Some browsers provide high-resolution time stamps for all events,\n // some provide low-resolution time stamps for all events. FF < 52\n // even mixes both time stamps together. Some browsers even report\n // negative time stamps or time stamps that are 0 (iOS9) in some cases.\n // Given we are only comparing two time stamps with equality (!==),\n // we are safe from the resolution differences. If the time stamp is 0\n // we bail-out of preventing the flush, which can affect semantics,\n // such as if an earlier flush removes or adds event listeners that\n // are fired in the subsequent flush. However, this is the same\n // behaviour as we had before this change, so the risks are low.\n if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) {\n lastFlushedEventTimeStamp = timeStamp;\n flushDiscreteUpdatesImpl();\n }\n}\nfunction setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {\n batchedUpdatesImpl = _batchedUpdatesImpl;\n discreteUpdatesImpl = _discreteUpdatesImpl;\n flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;\n batchedEventUpdatesImpl = _batchedEventUpdatesImpl;\n}\n\nvar DiscreteEvent = 0;\nvar UserBlockingEvent = 1;\nvar ContinuousEvent = 2;\n\n// CommonJS interop named imports.\n\nvar UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;\nvar runWithPriority = Scheduler.unstable_runWithPriority;\nvar listenToResponderEventTypesImpl;\nfunction setListenToResponderEventTypes(_listenToResponderEventTypesImpl) {\n listenToResponderEventTypesImpl = _listenToResponderEventTypesImpl;\n}\nvar activeTimeouts = new Map();\nvar rootEventTypesToEventResponderInstances = new Map();\nvar DoNotPropagateToNextResponder = 0;\nvar PropagateToNextResponder = 1;\nvar currentTimeStamp = 0;\nvar currentTimers = new Map();\nvar currentInstance = null;\nvar currentTimerIDCounter = 0;\nvar currentDocument = null;\nvar currentPropagationBehavior = DoNotPropagateToNextResponder;\nvar eventResponderContext = {\n dispatchEvent: function (eventValue, eventListener, eventPriority) {\n validateResponderContext();\n validateEventValue(eventValue);\n\n switch (eventPriority) {\n case DiscreteEvent:\n {\n flushDiscreteUpdatesIfNeeded(currentTimeStamp);\n discreteUpdates(function () {\n return executeUserEventHandler(eventListener, eventValue);\n });\n break;\n }\n\n case UserBlockingEvent:\n {\n if (enableUserBlockingEvents) {\n runWithPriority(UserBlockingPriority, function () {\n return executeUserEventHandler(eventListener, eventValue);\n });\n } else {\n executeUserEventHandler(eventListener, eventValue);\n }\n\n break;\n }\n\n case ContinuousEvent:\n {\n executeUserEventHandler(eventListener, eventValue);\n break;\n }\n }\n },\n isTargetWithinResponder: function (target) {\n validateResponderContext();\n\n if (target != null) {\n var fiber = getClosestInstanceFromNode(target);\n var responderFiber = currentInstance.fiber;\n\n while (fiber !== null) {\n if (fiber === responderFiber || fiber.alternate === responderFiber) {\n return true;\n }\n\n fiber = fiber.return;\n }\n }\n\n return false;\n },\n isTargetWithinResponderScope: function (target) {\n validateResponderContext();\n var componentInstance = currentInstance;\n var responder = componentInstance.responder;\n\n if (target != null) {\n var fiber = getClosestInstanceFromNode(target);\n var responderFiber = currentInstance.fiber;\n\n while (fiber !== null) {\n if (fiber === responderFiber || fiber.alternate === responderFiber) {\n return true;\n }\n\n if (doesFiberHaveResponder(fiber, responder)) {\n return false;\n }\n\n fiber = fiber.return;\n }\n }\n\n return false;\n },\n isTargetWithinNode: function (childTarget, parentTarget) {\n validateResponderContext();\n var childFiber = getClosestInstanceFromNode(childTarget);\n var parentFiber = getClosestInstanceFromNode(parentTarget);\n\n if (childFiber != null && parentFiber != null) {\n var parentAlternateFiber = parentFiber.alternate;\n var node = childFiber;\n\n while (node !== null) {\n if (node === parentFiber || node === parentAlternateFiber) {\n return true;\n }\n\n node = node.return;\n }\n\n return false;\n } // Fallback to DOM APIs\n\n\n return parentTarget.contains(childTarget);\n },\n addRootEventTypes: function (rootEventTypes) {\n validateResponderContext();\n listenToResponderEventTypesImpl(rootEventTypes, currentDocument);\n\n for (var i = 0; i < rootEventTypes.length; i++) {\n var rootEventType = rootEventTypes[i];\n var eventResponderInstance = currentInstance;\n registerRootEventType(rootEventType, eventResponderInstance);\n }\n },\n removeRootEventTypes: function (rootEventTypes) {\n validateResponderContext();\n\n for (var i = 0; i < rootEventTypes.length; i++) {\n var rootEventType = rootEventTypes[i];\n var rootEventResponders = rootEventTypesToEventResponderInstances.get(rootEventType);\n var rootEventTypesSet = currentInstance.rootEventTypes;\n\n if (rootEventTypesSet !== null) {\n rootEventTypesSet.delete(rootEventType);\n }\n\n if (rootEventResponders !== undefined) {\n rootEventResponders.delete(currentInstance);\n }\n }\n },\n setTimeout: function (func, delay) {\n validateResponderContext();\n\n if (currentTimers === null) {\n currentTimers = new Map();\n }\n\n var timeout = currentTimers.get(delay);\n var timerId = currentTimerIDCounter++;\n\n if (timeout === undefined) {\n var timers = new Map();\n var id = setTimeout(function () {\n processTimers(timers, delay);\n }, delay);\n timeout = {\n id: id,\n timers: timers\n };\n currentTimers.set(delay, timeout);\n }\n\n timeout.timers.set(timerId, {\n instance: currentInstance,\n func: func,\n id: timerId,\n timeStamp: currentTimeStamp\n });\n activeTimeouts.set(timerId, timeout);\n return timerId;\n },\n clearTimeout: function (timerId) {\n validateResponderContext();\n var timeout = activeTimeouts.get(timerId);\n\n if (timeout !== undefined) {\n var timers = timeout.timers;\n timers.delete(timerId);\n\n if (timers.size === 0) {\n clearTimeout(timeout.id);\n }\n }\n },\n getActiveDocument: getActiveDocument,\n objectAssign: _assign,\n getTimeStamp: function () {\n validateResponderContext();\n return currentTimeStamp;\n },\n isTargetWithinHostComponent: function (target, elementType) {\n validateResponderContext();\n var fiber = getClosestInstanceFromNode(target);\n\n while (fiber !== null) {\n if (fiber.tag === HostComponent && fiber.type === elementType) {\n return true;\n }\n\n fiber = fiber.return;\n }\n\n return false;\n },\n continuePropagation: function () {\n currentPropagationBehavior = PropagateToNextResponder;\n },\n enqueueStateRestore: enqueueStateRestore,\n getResponderNode: function () {\n validateResponderContext();\n var responderFiber = currentInstance.fiber;\n\n if (responderFiber.tag === ScopeComponent) {\n return null;\n }\n\n return responderFiber.stateNode;\n }\n};\n\nfunction validateEventValue(eventValue) {\n if (typeof eventValue === 'object' && eventValue !== null) {\n var target = eventValue.target,\n type = eventValue.type,\n timeStamp = eventValue.timeStamp;\n\n if (target == null || type == null || timeStamp == null) {\n throw new Error('context.dispatchEvent: \"target\", \"timeStamp\", and \"type\" fields on event object are required.');\n }\n\n var showWarning = function (name) {\n {\n warning$1(false, '%s is not available on event objects created from event responder modules (React Flare). ' + 'Try wrapping in a conditional, i.e. `if (event.type !== \"press\") { event.%s }`', name, name);\n }\n };\n\n eventValue.isDefaultPrevented = function () {\n {\n showWarning('isDefaultPrevented()');\n }\n };\n\n eventValue.isPropagationStopped = function () {\n {\n showWarning('isPropagationStopped()');\n }\n }; // $FlowFixMe: we don't need value, Flow thinks we do\n\n\n Object.defineProperty(eventValue, 'nativeEvent', {\n get: function () {\n {\n showWarning('nativeEvent');\n }\n }\n });\n }\n}\n\nfunction doesFiberHaveResponder(fiber, responder) {\n var tag = fiber.tag;\n\n if (tag === HostComponent || tag === ScopeComponent) {\n var dependencies = fiber.dependencies;\n\n if (dependencies !== null) {\n var respondersMap = dependencies.responders;\n\n if (respondersMap !== null && respondersMap.has(responder)) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nfunction getActiveDocument() {\n return currentDocument;\n}\n\nfunction processTimers(timers, delay) {\n var timersArr = Array.from(timers.values());\n var previousInstance = currentInstance;\n var previousTimers = currentTimers;\n\n try {\n batchedEventUpdates(function () {\n for (var i = 0; i < timersArr.length; i++) {\n var _timersArr$i = timersArr[i],\n instance = _timersArr$i.instance,\n func = _timersArr$i.func,\n id = _timersArr$i.id,\n timeStamp = _timersArr$i.timeStamp;\n currentInstance = instance;\n currentTimeStamp = timeStamp + delay;\n\n try {\n func();\n } finally {\n activeTimeouts.delete(id);\n }\n }\n });\n } finally {\n currentTimers = previousTimers;\n currentInstance = previousInstance;\n currentTimeStamp = 0;\n }\n}\n\nfunction createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, passive, passiveSupported) {\n var _ref = nativeEvent,\n buttons = _ref.buttons,\n pointerType = _ref.pointerType;\n var eventPointerType = '';\n\n if (pointerType !== undefined) {\n eventPointerType = pointerType;\n } else if (nativeEvent.key !== undefined) {\n eventPointerType = 'keyboard';\n } else if (buttons !== undefined) {\n eventPointerType = 'mouse';\n } else if (nativeEvent.changedTouches !== undefined) {\n eventPointerType = 'touch';\n }\n\n return {\n nativeEvent: nativeEvent,\n passive: passive,\n passiveSupported: passiveSupported,\n pointerType: eventPointerType,\n target: nativeEventTarget,\n type: topLevelType\n };\n}\n\nfunction responderEventTypesContainType(eventTypes, type) {\n for (var i = 0, len = eventTypes.length; i < len; i++) {\n if (eventTypes[i] === type) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction validateResponderTargetEventTypes(eventType, responder) {\n var targetEventTypes = responder.targetEventTypes; // Validate the target event type exists on the responder\n\n if (targetEventTypes !== null) {\n return responderEventTypesContainType(targetEventTypes, eventType);\n }\n\n return false;\n}\n\nfunction traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var isPassiveEvent = (eventSystemFlags & IS_PASSIVE) !== 0;\n var isPassiveSupported = (eventSystemFlags & PASSIVE_NOT_SUPPORTED) === 0;\n var isPassive = isPassiveEvent || !isPassiveSupported;\n var eventType = isPassive ? topLevelType : topLevelType + '_active'; // Trigger event responders in this order:\n // - Bubble target responder phase\n // - Root responder phase\n\n var visitedResponders = new Set();\n var responderEvent = createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, isPassiveEvent, isPassiveSupported);\n var node = targetFiber;\n var insidePortal = false;\n\n while (node !== null) {\n var _node = node,\n dependencies = _node.dependencies,\n tag = _node.tag;\n\n if (tag === HostPortal) {\n insidePortal = true;\n } else if ((tag === HostComponent || tag === ScopeComponent) && dependencies !== null) {\n var respondersMap = dependencies.responders;\n\n if (respondersMap !== null) {\n var responderInstances = Array.from(respondersMap.values());\n\n for (var i = 0, length = responderInstances.length; i < length; i++) {\n var responderInstance = responderInstances[i];\n var props = responderInstance.props,\n responder = responderInstance.responder,\n state = responderInstance.state;\n\n if (!visitedResponders.has(responder) && validateResponderTargetEventTypes(eventType, responder) && (!insidePortal || responder.targetPortalPropagation)) {\n visitedResponders.add(responder);\n var onEvent = responder.onEvent;\n\n if (onEvent !== null) {\n currentInstance = responderInstance;\n onEvent(responderEvent, eventResponderContext, props, state);\n\n if (currentPropagationBehavior === PropagateToNextResponder) {\n visitedResponders.delete(responder);\n currentPropagationBehavior = DoNotPropagateToNextResponder;\n }\n }\n }\n }\n }\n }\n\n node = node.return;\n } // Root phase\n\n\n var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(eventType);\n\n if (rootEventResponderInstances !== undefined) {\n var _responderInstances = Array.from(rootEventResponderInstances);\n\n for (var _i = 0; _i < _responderInstances.length; _i++) {\n var _responderInstance = _responderInstances[_i];\n var props = _responderInstance.props,\n responder = _responderInstance.responder,\n state = _responderInstance.state;\n var onRootEvent = responder.onRootEvent;\n\n if (onRootEvent !== null) {\n currentInstance = _responderInstance;\n onRootEvent(responderEvent, eventResponderContext, props, state);\n }\n }\n }\n}\n\nfunction mountEventResponder(responder, responderInstance, props, state) {\n var onMount = responder.onMount;\n\n if (onMount !== null) {\n var previousInstance = currentInstance;\n var previousTimers = currentTimers;\n currentInstance = responderInstance;\n\n try {\n batchedEventUpdates(function () {\n onMount(eventResponderContext, props, state);\n });\n } finally {\n currentInstance = previousInstance;\n currentTimers = previousTimers;\n }\n }\n}\nfunction unmountEventResponder(responderInstance) {\n var responder = responderInstance.responder;\n var onUnmount = responder.onUnmount;\n\n if (onUnmount !== null) {\n var props = responderInstance.props,\n state = responderInstance.state;\n var previousInstance = currentInstance;\n var previousTimers = currentTimers;\n currentInstance = responderInstance;\n\n try {\n batchedEventUpdates(function () {\n onUnmount(eventResponderContext, props, state);\n });\n } finally {\n currentInstance = previousInstance;\n currentTimers = previousTimers;\n }\n }\n\n var rootEventTypesSet = responderInstance.rootEventTypes;\n\n if (rootEventTypesSet !== null) {\n var rootEventTypes = Array.from(rootEventTypesSet);\n\n for (var i = 0; i < rootEventTypes.length; i++) {\n var topLevelEventType = rootEventTypes[i];\n var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(topLevelEventType);\n\n if (rootEventResponderInstances !== undefined) {\n rootEventResponderInstances.delete(responderInstance);\n }\n }\n }\n}\n\nfunction validateResponderContext() {\n (function () {\n if (!(currentInstance !== null)) {\n {\n throw ReactError(Error(\"An event responder context was used outside of an event cycle. Use context.setTimeout() to use asynchronous responder context outside of event cycle .\"));\n }\n }\n })();\n}\n\nfunction dispatchEventForResponderEventSystem(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {\n if (enableFlareAPI) {\n var previousInstance = currentInstance;\n var previousTimers = currentTimers;\n var previousTimeStamp = currentTimeStamp;\n var previousDocument = currentDocument;\n var previousPropagationBehavior = currentPropagationBehavior;\n currentPropagationBehavior = DoNotPropagateToNextResponder;\n currentTimers = null; // nodeType 9 is DOCUMENT_NODE\n\n currentDocument = nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument; // We might want to control timeStamp another way here\n\n currentTimeStamp = nativeEvent.timeStamp;\n\n try {\n batchedEventUpdates(function () {\n traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags);\n });\n } finally {\n currentTimers = previousTimers;\n currentInstance = previousInstance;\n currentTimeStamp = previousTimeStamp;\n currentDocument = previousDocument;\n currentPropagationBehavior = previousPropagationBehavior;\n }\n }\n}\nfunction addRootEventTypesForResponderInstance(responderInstance, rootEventTypes) {\n for (var i = 0; i < rootEventTypes.length; i++) {\n var rootEventType = rootEventTypes[i];\n registerRootEventType(rootEventType, responderInstance);\n }\n}\n\nfunction registerRootEventType(rootEventType, eventResponderInstance) {\n var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(rootEventType);\n\n if (rootEventResponderInstances === undefined) {\n rootEventResponderInstances = new Set();\n rootEventTypesToEventResponderInstances.set(rootEventType, rootEventResponderInstances);\n }\n\n var rootEventTypesSet = eventResponderInstance.rootEventTypes;\n\n if (rootEventTypesSet === null) {\n rootEventTypesSet = eventResponderInstance.rootEventTypes = new Set();\n }\n\n (function () {\n if (!!rootEventTypesSet.has(rootEventType)) {\n {\n throw ReactError(Error(\"addRootEventTypes() found a duplicate root event type of \\\"\" + rootEventType + \"\\\". This might be because the event type exists in the event responder \\\"rootEventTypes\\\" array or because of a previous addRootEventTypes() using this root event type.\"));\n }\n }\n })();\n\n rootEventTypesSet.add(rootEventType);\n rootEventResponderInstances.add(eventResponderInstance);\n}\n\n// A reserved attribute.\n// It is handled by React separately and shouldn't be written to the DOM.\nvar RESERVED = 0; // A simple string attribute.\n// Attributes that aren't in the whitelist are presumed to have this type.\n\nvar STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called\n// \"enumerated\" attributes with \"true\" and \"false\" as possible values.\n// When true, it should be set to a \"true\" string.\n// When false, it should be set to a \"false\" string.\n\nvar BOOLEANISH_STRING = 2; // A real boolean attribute.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\n\nvar BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\n// For any other value, should be present with that value.\n\nvar OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n// When falsy, it should be removed.\n\nvar NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n// When falsy, it should be removed.\n\nvar POSITIVE_NUMERIC = 6;\n\n/* eslint-disable max-len */\nvar ATTRIBUTE_NAME_START_CHAR = \":A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n/* eslint-enable max-len */\n\nvar ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n\nvar ROOT_ATTRIBUTE_NAME = 'data-reactroot';\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n return true;\n }\n\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n return false;\n }\n\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n validatedAttributeNameCache[attributeName] = true;\n return true;\n }\n\n illegalAttributeNameCache[attributeName] = true;\n\n {\n warning$1(false, 'Invalid attribute name: `%s`', attributeName);\n }\n\n return false;\n}\nfunction shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null) {\n return propertyInfo.type === RESERVED;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return true;\n }\n\n return false;\n}\nfunction shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n return false;\n }\n\n switch (typeof value) {\n case 'function': // $FlowIssue symbol is perfectly valid here\n\n case 'symbol':\n // eslint-disable-line\n return true;\n\n case 'boolean':\n {\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n return !propertyInfo.acceptsBooleans;\n } else {\n var prefix = name.toLowerCase().slice(0, 5);\n return prefix !== 'data-' && prefix !== 'aria-';\n }\n }\n\n default:\n return false;\n }\n}\nfunction shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {\n if (value === null || typeof value === 'undefined') {\n return true;\n }\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n return true;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n switch (propertyInfo.type) {\n case BOOLEAN:\n return !value;\n\n case OVERLOADED_BOOLEAN:\n return value === false;\n\n case NUMERIC:\n return isNaN(value);\n\n case POSITIVE_NUMERIC:\n return isNaN(value) || value < 1;\n }\n }\n\n return false;\n}\nfunction getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n}\n\nfunction PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {\n this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n this.attributeName = attributeName;\n this.attributeNamespace = attributeNamespace;\n this.mustUseProperty = mustUseProperty;\n this.propertyName = name;\n this.type = type;\n this.sanitizeURL = sanitizeURL;\n} // When adding attributes to this list, be sure to also add them to\n// the `possibleStandardNames` module to ensure casing and incorrect\n// name warnings.\n\n\nvar properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\n\n['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular\n// elements (not just inputs). Now that ReactDOMInput assigns to the\n// defaultValue property -- do we need this?\n'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // A few React string attributes have a different name.\n// This is a mapping from React prop names to the attribute names.\n\n[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {\n var name = _ref[0],\n attributeName = _ref[1];\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, // attributeName\n null, // attributeNamespace\n false);\n}); // These are \"enumerated\" HTML attributes that accept \"true\" and \"false\".\n// In React, we let users pass `true` and `false` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n\n['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false);\n}); // These are \"enumerated\" SVG attributes that accept \"true\" and \"false\".\n// In React, we let users pass `true` and `false` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n// Since these are SVG attributes, their attribute names are case-sensitive.\n\n['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // These are HTML boolean attributes.\n\n['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM\n// on the client side because the browsers are inconsistent. Instead we call focus().\n'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata\n'itemScope'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false);\n}); // These are the few React props that we set as DOM properties\n// rather than attributes. These are all booleans.\n\n['checked', // Note: `option.selected` is not updated if `select.multiple` is\n// disabled with `removeAttribute`. We have special logic for handling this.\n'multiple', 'muted', 'selected'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // These are HTML attributes that are \"overloaded booleans\": they behave like\n// booleans, but can also accept a string value.\n\n['capture', 'download'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // These are HTML attributes that must be positive numbers.\n\n['cols', 'rows', 'size', 'span'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // These are HTML attributes that must be numbers.\n\n['rowSpan', 'start'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false);\n});\nvar CAMELIZE = /[\\-\\:]([a-z])/g;\n\nvar capitalize = function (token) {\n return token[1].toUpperCase();\n}; // This is a list of all SVG attributes that need special casing, namespacing,\n// or boolean value assignment. Regular attributes that just accept strings\n// and have the same names are omitted, just like in the HTML whitelist.\n// Some of these attributes can be hard to find. This list was created by\n// scrapping the MDN documentation.\n\n\n['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, null, // attributeNamespace\n false);\n}); // String SVG attributes with the xlink namespace.\n\n['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/1999/xlink', false);\n}); // String SVG attributes with the xml namespace.\n\n['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/XML/1998/namespace', false);\n}); // These attribute exists both in HTML and SVG.\n// The attribute name is case-sensitive in SVG so we can't just use\n// the React name like we do for attributes that exist only in HTML.\n\n['tabIndex', 'crossOrigin'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n false);\n}); // These attributes accept URLs. These must not allow javascript: URLS.\n// These will also need to accept Trusted Types object in the future.\n\nvar xlinkHref = 'xlinkHref';\nproperties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty\n'xlink:href', 'http://www.w3.org/1999/xlink', true);\n['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n true);\n});\n\nvar ReactDebugCurrentFrame$1 = null;\n\n{\n ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n} // A javascript: URL can contain leading C0 control or \\u0020 SPACE,\n// and any newline or tab are filtered out as if they're not part of the URL.\n// https://url.spec.whatwg.org/#url-parsing\n// Tab or newline are defined as \\r\\n\\t:\n// https://infra.spec.whatwg.org/#ascii-tab-or-newline\n// A C0 control is a code point in the range \\u0000 NULL to \\u001F\n// INFORMATION SEPARATOR ONE, inclusive:\n// https://infra.spec.whatwg.org/#c0-control-or-space\n\n/* eslint-disable max-len */\n\n\nvar isJavaScriptProtocol = /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i;\nvar didWarn = false;\n\nfunction sanitizeURL(url) {\n if (disableJavaScriptURLs) {\n (function () {\n if (!!isJavaScriptProtocol.test(url)) {\n {\n throw ReactError(Error(\"React has blocked a javascript: URL as a security precaution.\" + (ReactDebugCurrentFrame$1.getStackAddendum())));\n }\n }\n })();\n } else if ( true && !didWarn && isJavaScriptProtocol.test(url)) {\n didWarn = true;\n warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));\n }\n}\n\n// Flow does not allow string concatenation of most non-string types. To work\n// around this limitation, we use an opaque type that can only be obtained by\n// passing the value through getToStringValue first.\nfunction toString(value) {\n return '' + value;\n}\nfunction getToStringValue(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'object':\n case 'string':\n case 'undefined':\n return value;\n\n default:\n // function, symbol are assigned as empty strings\n return '';\n }\n}\n/** Trusted value is a wrapper for \"safe\" values which can be assigned to DOM execution sinks. */\n\n/**\n * We allow passing objects with toString method as element attributes or in dangerouslySetInnerHTML\n * and we do validations that the value is safe. Once we do validation we want to use the validated\n * value instead of the object (because object.toString may return something else on next call).\n *\n * If application uses Trusted Types we don't stringify trusted values, but preserve them as objects.\n */\nvar toStringOrTrustedType = toString;\n\nif (enableTrustedTypesIntegration && typeof trustedTypes !== 'undefined') {\n var isHTML = trustedTypes.isHTML;\n var isScript = trustedTypes.isScript;\n var isScriptURL = trustedTypes.isScriptURL; // TrustedURLs are deprecated and will be removed soon: https://github.com/WICG/trusted-types/pull/204\n\n var isURL = trustedTypes.isURL ? trustedTypes.isURL : function (value) {\n return false;\n };\n\n toStringOrTrustedType = function (value) {\n if (typeof value === 'object' && (isHTML(value) || isScript(value) || isScriptURL(value) || isURL(value))) {\n // Pass Trusted Types through.\n return value;\n }\n\n return toString(value);\n };\n}\n\n/**\n * Set attribute for a node. The attribute value can be either string or\n * Trusted value (if application uses Trusted Types).\n */\nfunction setAttribute(node, attributeName, attributeValue) {\n node.setAttribute(attributeName, attributeValue);\n}\n/**\n * Set attribute with namespace for a node. The attribute value can be either string or\n * Trusted value (if application uses Trusted Types).\n */\n\nfunction setAttributeNS(node, attributeNamespace, attributeName, attributeValue) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n}\n\n/**\n * Get the value for a property on a node. Only used in DEV for SSR validation.\n * The \"expected\" argument is used as a hint of what the expected value is.\n * Some properties have multiple equivalent values.\n */\nfunction getValueForProperty(node, name, expected, propertyInfo) {\n {\n if (propertyInfo.mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n return node[propertyName];\n } else {\n if (!disableJavaScriptURLs && propertyInfo.sanitizeURL) {\n // If we haven't fully disabled javascript: URLs, and if\n // the hydration is successful of a javascript: URL, we\n // still want to warn on the client.\n sanitizeURL('' + expected);\n }\n\n var attributeName = propertyInfo.attributeName;\n var stringValue = null;\n\n if (propertyInfo.type === OVERLOADED_BOOLEAN) {\n if (node.hasAttribute(attributeName)) {\n var value = node.getAttribute(attributeName);\n\n if (value === '') {\n return true;\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return value;\n }\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n } else if (node.hasAttribute(attributeName)) {\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n // We had an attribute but shouldn't have had one, so read it\n // for the error message.\n return node.getAttribute(attributeName);\n }\n\n if (propertyInfo.type === BOOLEAN) {\n // If this was a boolean, it doesn't matter what the value is\n // the fact that we have it is the same as the expected.\n return expected;\n } // Even if this property uses a namespace we use getAttribute\n // because we assume its namespaced name is the same as our config.\n // To use getAttributeNS we need the local name which we don't have\n // in our config atm.\n\n\n stringValue = node.getAttribute(attributeName);\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return stringValue === null ? expected : stringValue;\n } else if (stringValue === '' + expected) {\n return expected;\n } else {\n return stringValue;\n }\n }\n }\n}\n/**\n * Get the value for a attribute on a node. Only used in DEV for SSR validation.\n * The third argument is used as a hint of what the expected value is. Some\n * attributes have multiple equivalent values.\n */\n\nfunction getValueForAttribute(node, name, expected) {\n {\n if (!isAttributeNameSafe(name)) {\n return;\n }\n\n if (!node.hasAttribute(name)) {\n return expected === undefined ? undefined : null;\n }\n\n var value = node.getAttribute(name);\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n}\n/**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n */\n\nfunction setValueForProperty(node, name, value, isCustomComponentTag) {\n var propertyInfo = getPropertyInfo(name);\n\n if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {\n return;\n }\n\n if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {\n value = null;\n } // If the prop isn't in the special list, treat it as a simple attribute.\n\n\n if (isCustomComponentTag || propertyInfo === null) {\n if (isAttributeNameSafe(name)) {\n var _attributeName = name;\n\n if (value === null) {\n node.removeAttribute(_attributeName);\n } else {\n setAttribute(node, _attributeName, toStringOrTrustedType(value));\n }\n }\n\n return;\n }\n\n var mustUseProperty = propertyInfo.mustUseProperty;\n\n if (mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n\n if (value === null) {\n var type = propertyInfo.type;\n node[propertyName] = type === BOOLEAN ? false : '';\n } else {\n // Contrary to `setAttribute`, object properties are properly\n // `toString`ed by IE8/9.\n node[propertyName] = value;\n }\n\n return;\n } // The rest are treated as attributes with special cases.\n\n\n var attributeName = propertyInfo.attributeName,\n attributeNamespace = propertyInfo.attributeNamespace;\n\n if (value === null) {\n node.removeAttribute(attributeName);\n } else {\n var _type = propertyInfo.type;\n var attributeValue;\n\n if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {\n // If attribute type is boolean, we know for sure it won't be an execution sink\n // and we won't require Trusted Type here.\n attributeValue = '';\n } else {\n // `setAttribute` with objects becomes only `[object]` in IE8/9,\n // ('' + value) makes it output the correct toString()-value.\n attributeValue = toStringOrTrustedType(value);\n\n if (propertyInfo.sanitizeURL) {\n sanitizeURL(attributeValue.toString());\n }\n }\n\n if (attributeNamespace) {\n setAttributeNS(node, attributeNamespace, attributeName, attributeValue);\n } else {\n setAttribute(node, attributeName, attributeValue);\n }\n }\n}\n\nvar ReactDebugCurrentFrame$2 = null;\nvar ReactControlledValuePropTypes = {\n checkPropTypes: null\n};\n\n{\n ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;\n var hasReadOnlyValue = {\n button: true,\n checkbox: true,\n image: true,\n hidden: true,\n radio: true,\n reset: true,\n submit: true\n };\n var propTypes = {\n value: function (props, propName, componentName) {\n if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {\n return null;\n }\n\n return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n },\n checked: function (props, propName, componentName) {\n if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {\n return null;\n }\n\n return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n };\n /**\n * Provide a linked `value` attribute for controlled forms. You should not use\n * this outside of the ReactDOM controlled form components.\n */\n\n ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {\n checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);\n };\n}\n\nfunction isCheckable(elem) {\n var type = elem.type;\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');\n}\n\nfunction getTracker(node) {\n return node._valueTracker;\n}\n\nfunction detachTracker(node) {\n node._valueTracker = null;\n}\n\nfunction getValueFromNode(node) {\n var value = '';\n\n if (!node) {\n return value;\n }\n\n if (isCheckable(node)) {\n value = node.checked ? 'true' : 'false';\n } else {\n value = node.value;\n }\n\n return value;\n}\n\nfunction trackValueOnNode(node) {\n var valueField = isCheckable(node) ? 'checked' : 'value';\n var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);\n var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail\n // and don't track value will cause over reporting of changes,\n // but it's better then a hard failure\n // (needed for certain tests that spyOn input values and Safari)\n\n if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {\n return;\n }\n\n var get = descriptor.get,\n set = descriptor.set;\n Object.defineProperty(node, valueField, {\n configurable: true,\n get: function () {\n return get.call(this);\n },\n set: function (value) {\n currentValue = '' + value;\n set.call(this, value);\n }\n }); // We could've passed this the first time\n // but it triggers a bug in IE11 and Edge 14/15.\n // Calling defineProperty() again should be equivalent.\n // https://github.com/facebook/react/issues/11768\n\n Object.defineProperty(node, valueField, {\n enumerable: descriptor.enumerable\n });\n var tracker = {\n getValue: function () {\n return currentValue;\n },\n setValue: function (value) {\n currentValue = '' + value;\n },\n stopTracking: function () {\n detachTracker(node);\n delete node[valueField];\n }\n };\n return tracker;\n}\n\nfunction track(node) {\n if (getTracker(node)) {\n return;\n } // TODO: Once it's just Fiber we can move this to node._wrapperState\n\n\n node._valueTracker = trackValueOnNode(node);\n}\nfunction updateValueIfChanged(node) {\n if (!node) {\n return false;\n }\n\n var tracker = getTracker(node); // if there is no tracker at this point it's unlikely\n // that trying again will succeed\n\n if (!tracker) {\n return true;\n }\n\n var lastValue = tracker.getValue();\n var nextValue = getValueFromNode(node);\n\n if (nextValue !== lastValue) {\n tracker.setValue(nextValue);\n return true;\n }\n\n return false;\n}\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\n\nfunction isControlled(props) {\n var usesChecked = props.type === 'checkbox' || props.type === 'radio';\n return usesChecked ? props.checked != null : props.value != null;\n}\n/**\n * Implements an host component that allows setting these optional\n * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.\n *\n * If `checked` or `value` are not supplied (or null/undefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null/undefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or `defaultChecked`)\n * with an empty value (or `defaultValue`).\n *\n * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html\n */\n\n\nfunction getHostProps(element, props) {\n var node = element;\n var checked = props.checked;\n\n var hostProps = _assign({}, props, {\n defaultChecked: undefined,\n defaultValue: undefined,\n value: undefined,\n checked: checked != null ? checked : node._wrapperState.initialChecked\n });\n\n return hostProps;\n}\nfunction initWrapperState(element, props) {\n {\n ReactControlledValuePropTypes.checkPropTypes('input', props);\n\n if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n didWarnCheckedDefaultChecked = true;\n }\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n didWarnValueDefaultValue = true;\n }\n }\n\n var node = element;\n var defaultValue = props.defaultValue == null ? '' : props.defaultValue;\n node._wrapperState = {\n initialChecked: props.checked != null ? props.checked : props.defaultChecked,\n initialValue: getToStringValue(props.value != null ? props.value : defaultValue),\n controlled: isControlled(props)\n };\n}\nfunction updateChecked(element, props) {\n var node = element;\n var checked = props.checked;\n\n if (checked != null) {\n setValueForProperty(node, 'checked', checked, false);\n }\n}\nfunction updateWrapper(element, props) {\n var node = element;\n\n {\n var controlled = isControlled(props);\n\n if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {\n warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n didWarnUncontrolledToControlled = true;\n }\n\n if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {\n warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n didWarnControlledToUncontrolled = true;\n }\n }\n\n updateChecked(element, props);\n var value = getToStringValue(props.value);\n var type = props.type;\n\n if (value != null) {\n if (type === 'number') {\n if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.\n // eslint-disable-next-line\n node.value != value) {\n node.value = toString(value);\n }\n } else if (node.value !== toString(value)) {\n node.value = toString(value);\n }\n } else if (type === 'submit' || type === 'reset') {\n // Submit/reset inputs need the attribute removed completely to avoid\n // blank-text buttons.\n node.removeAttribute('value');\n return;\n }\n\n if (disableInputAttributeSyncing) {\n // When not syncing the value attribute, React only assigns a new value\n // whenever the defaultValue React prop has changed. When not present,\n // React does nothing\n if (props.hasOwnProperty('defaultValue')) {\n setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n }\n } else {\n // When syncing the value attribute, the value comes from a cascade of\n // properties:\n // 1. The value React property\n // 2. The defaultValue React property\n // 3. Otherwise there should be no change\n if (props.hasOwnProperty('value')) {\n setDefaultValue(node, props.type, value);\n } else if (props.hasOwnProperty('defaultValue')) {\n setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n }\n }\n\n if (disableInputAttributeSyncing) {\n // When not syncing the checked attribute, the attribute is directly\n // controllable from the defaultValue React property. It needs to be\n // updated as new props come in.\n if (props.defaultChecked == null) {\n node.removeAttribute('checked');\n } else {\n node.defaultChecked = !!props.defaultChecked;\n }\n } else {\n // When syncing the checked attribute, it only changes when it needs\n // to be removed, such as transitioning from a checkbox into a text input\n if (props.checked == null && props.defaultChecked != null) {\n node.defaultChecked = !!props.defaultChecked;\n }\n }\n}\nfunction postMountWrapper(element, props, isHydrating) {\n var node = element; // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {\n var type = props.type;\n var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the\n // default value provided by the browser. See: #12872\n\n if (isButton && (props.value === undefined || props.value === null)) {\n return;\n }\n\n var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (!isHydrating) {\n if (disableInputAttributeSyncing) {\n var value = getToStringValue(props.value); // When not syncing the value attribute, the value property points\n // directly to the React prop. Only assign it if it exists.\n\n if (value != null) {\n // Always assign on buttons so that it is possible to assign an\n // empty string to clear button text.\n //\n // Otherwise, do not re-assign the value property if is empty. This\n // potentially avoids a DOM write and prevents Firefox (~60.0.1) from\n // prematurely marking required inputs as invalid. Equality is compared\n // to the current value in case the browser provided value is not an\n // empty string.\n if (isButton || value !== node.value) {\n node.value = toString(value);\n }\n }\n } else {\n // When syncing the value attribute, the value property should use\n // the wrapperState._initialValue property. This uses:\n //\n // 1. The value React property when present\n // 2. The defaultValue React property when present\n // 3. An empty string\n if (initialValue !== node.value) {\n node.value = initialValue;\n }\n }\n }\n\n if (disableInputAttributeSyncing) {\n // When not syncing the value attribute, assign the value attribute\n // directly from the defaultValue React property (when present)\n var defaultValue = getToStringValue(props.defaultValue);\n\n if (defaultValue != null) {\n node.defaultValue = toString(defaultValue);\n }\n } else {\n // Otherwise, the value attribute is synchronized to the property,\n // so we assign defaultValue to the same thing as the value property\n // assignment step above.\n node.defaultValue = initialValue;\n }\n } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug\n // this is needed to work around a chrome bug where setting defaultChecked\n // will sometimes influence the value of checked (even after detachment).\n // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416\n // We need to temporarily unset name to avoid disrupting radio button groups.\n\n\n var name = node.name;\n\n if (name !== '') {\n node.name = '';\n }\n\n if (disableInputAttributeSyncing) {\n // When not syncing the checked attribute, the checked property\n // never gets assigned. It must be manually set. We don't want\n // to do this when hydrating so that existing user input isn't\n // modified\n if (!isHydrating) {\n updateChecked(element, props);\n } // Only assign the checked attribute if it is defined. This saves\n // a DOM write when controlling the checked attribute isn't needed\n // (text inputs, submit/reset)\n\n\n if (props.hasOwnProperty('defaultChecked')) {\n node.defaultChecked = !node.defaultChecked;\n node.defaultChecked = !!props.defaultChecked;\n }\n } else {\n // When syncing the checked attribute, both the checked property and\n // attribute are assigned at the same time using defaultChecked. This uses:\n //\n // 1. The checked React property when present\n // 2. The defaultChecked React property when present\n // 3. Otherwise, false\n node.defaultChecked = !node.defaultChecked;\n node.defaultChecked = !!node._wrapperState.initialChecked;\n }\n\n if (name !== '') {\n node.name = name;\n }\n}\nfunction restoreControlledState$1(element, props) {\n var node = element;\n updateWrapper(node, props);\n updateNamedCousins(node, props);\n}\n\nfunction updateNamedCousins(rootNode, props) {\n var name = props.name;\n\n if (props.type === 'radio' && name != null) {\n var queryRoot = rootNode;\n\n while (queryRoot.parentNode) {\n queryRoot = queryRoot.parentNode;\n } // If `rootNode.form` was non-null, then we could try `form.elements`,\n // but that sometimes behaves strangely in IE8. We could also try using\n // `form.getElementsByName`, but that will only return direct children\n // and won't include inputs that use the HTML5 `form=` attribute. Since\n // the input might not even be in a form. It might not even be in the\n // document. Let's just use the local `querySelectorAll` to ensure we don't\n // miss anything.\n\n\n var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\"radio\"]');\n\n for (var i = 0; i < group.length; i++) {\n var otherNode = group[i];\n\n if (otherNode === rootNode || otherNode.form !== rootNode.form) {\n continue;\n } // This will throw if radio buttons rendered by different copies of React\n // and the same name are rendered into the same form (same as #1939).\n // That's probably okay; we don't support it just as we don't support\n // mixing React radio buttons with non-React ones.\n\n\n var otherProps = getFiberCurrentPropsFromNode$1(otherNode);\n\n (function () {\n if (!otherProps) {\n {\n throw ReactError(Error(\"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.\"));\n }\n }\n })(); // We need update the tracked value on the named cousin since the value\n // was changed but the input saw no event or value set\n\n\n updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that\n // was previously checked to update will cause it to be come re-checked\n // as appropriate.\n\n updateWrapper(otherNode, otherProps);\n }\n }\n} // In Chrome, assigning defaultValue to certain input types triggers input validation.\n// For number inputs, the display value loses trailing decimal points. For email inputs,\n// Chrome raises \"The specified value is not a valid email address\".\n//\n// Here we check to see if the defaultValue has actually changed, avoiding these problems\n// when the user is inputting text\n//\n// https://github.com/facebook/react/issues/7253\n\n\nfunction setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}\n\nvar didWarnSelectedSetOnOption = false;\nvar didWarnInvalidChild = false;\n\nfunction flattenChildren(children) {\n var content = ''; // Flatten children. We'll warn if they are invalid\n // during validateProps() which runs for hydration too.\n // Note that this would throw on non-element objects.\n // Elements are stringified (which is normally irrelevant\n // but matters for ).\n\n React.Children.forEach(children, function (child) {\n if (child == null) {\n return;\n }\n\n content += child; // Note: we don't warn about invalid children here.\n // Instead, this is done separately below so that\n // it happens during the hydration codepath too.\n });\n return content;\n}\n/**\n * Implements an host component that warns when `selected` is set.\n */\n\n\nfunction validateProps(element, props) {\n {\n // This mirrors the codepath above, but runs for hydration too.\n // Warn about invalid children here so that client and hydration are consistent.\n // TODO: this seems like it could cause a DEV-only throw for hydration\n // if children contains a non-element object. We should try to avoid that.\n if (typeof props.children === 'object' && props.children !== null) {\n React.Children.forEach(props.children, function (child) {\n if (child == null) {\n return;\n }\n\n if (typeof child === 'string' || typeof child === 'number') {\n return;\n }\n\n if (typeof child.type !== 'string') {\n return;\n }\n\n if (!didWarnInvalidChild) {\n didWarnInvalidChild = true;\n warning$1(false, 'Only strings and numbers are supported as children.');\n }\n });\n } // TODO: Remove support for `selected` in .\n\n\n if (props.selected != null && !didWarnSelectedSetOnOption) {\n warning$1(false, 'Use the `defaultValue` or `value` props on instead of ' + 'setting `selected` on .');\n didWarnSelectedSetOnOption = true;\n }\n }\n}\nfunction postMountWrapper$1(element, props) {\n // value=\"\" should make a value attribute (#6219)\n if (props.value != null) {\n element.setAttribute('value', toString(getToStringValue(props.value)));\n }\n}\nfunction getHostProps$1(element, props) {\n var hostProps = _assign({\n children: undefined\n }, props);\n\n var content = flattenChildren(props.children);\n\n if (content) {\n hostProps.children = content;\n }\n\n return hostProps;\n}\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar didWarnValueDefaultValue$1;\n\n{\n didWarnValueDefaultValue$1 = false;\n}\n\nfunction getDeclarationErrorAddendum() {\n var ownerName = getCurrentFiberOwnerNameInDevOrNull();\n\n if (ownerName) {\n return '\\n\\nCheck the render method of `' + ownerName + '`.';\n }\n\n return '';\n}\n\nvar valuePropNames = ['value', 'defaultValue'];\n/**\n * Validation function for `value` and `defaultValue`.\n */\n\nfunction checkSelectPropTypes(props) {\n ReactControlledValuePropTypes.checkPropTypes('select', props);\n\n for (var i = 0; i < valuePropNames.length; i++) {\n var propName = valuePropNames[i];\n\n if (props[propName] == null) {\n continue;\n }\n\n var isArray = Array.isArray(props[propName]);\n\n if (props.multiple && !isArray) {\n warning$1(false, 'The `%s` prop supplied to must be an array if ' + '`multiple` is true.%s', propName, getDeclarationErrorAddendum());\n } else if (!props.multiple && isArray) {\n warning$1(false, 'The `%s` prop supplied to must be a scalar ' + 'value if `multiple` is false.%s', propName, getDeclarationErrorAddendum());\n }\n }\n}\n\nfunction updateOptions(node, multiple, propValue, setDefaultSelected) {\n var options = node.options;\n\n if (multiple) {\n var selectedValues = propValue;\n var selectedValue = {};\n\n for (var i = 0; i < selectedValues.length; i++) {\n // Prefix to avoid chaos with special keys.\n selectedValue['$' + selectedValues[i]] = true;\n }\n\n for (var _i = 0; _i < options.length; _i++) {\n var selected = selectedValue.hasOwnProperty('$' + options[_i].value);\n\n if (options[_i].selected !== selected) {\n options[_i].selected = selected;\n }\n\n if (selected && setDefaultSelected) {\n options[_i].defaultSelected = true;\n }\n }\n } else {\n // Do not set `select.value` as exact behavior isn't consistent across all\n // browsers for all cases.\n var _selectedValue = toString(getToStringValue(propValue));\n\n var defaultSelected = null;\n\n for (var _i2 = 0; _i2 < options.length; _i2++) {\n if (options[_i2].value === _selectedValue) {\n options[_i2].selected = true;\n\n if (setDefaultSelected) {\n options[_i2].defaultSelected = true;\n }\n\n return;\n }\n\n if (defaultSelected === null && !options[_i2].disabled) {\n defaultSelected = options[_i2];\n }\n }\n\n if (defaultSelected !== null) {\n defaultSelected.selected = true;\n }\n }\n}\n/**\n * Implements a host component that allows optionally setting the\n * props `value` and `defaultValue`. If `multiple` is false, the prop must be a\n * stringable. If `multiple` is true, the prop must be an array of stringables.\n *\n * If `value` is not supplied (or null/undefined), user actions that change the\n * selected option will trigger updates to the rendered options.\n *\n * If it is supplied (and not null/undefined), the rendered options will not\n * update in response to user actions. Instead, the `value` prop must change in\n * order for the rendered options to update.\n *\n * If `defaultValue` is provided, any options with the supplied values will be\n * selected.\n */\n\n\nfunction getHostProps$2(element, props) {\n return _assign({}, props, {\n value: undefined\n });\n}\nfunction initWrapperState$1(element, props) {\n var node = element;\n\n {\n checkSelectPropTypes(props);\n }\n\n node._wrapperState = {\n wasMultiple: !!props.multiple\n };\n\n {\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue$1) {\n warning$1(false, 'Select elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled select ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components');\n didWarnValueDefaultValue$1 = true;\n }\n }\n}\nfunction postMountWrapper$2(element, props) {\n var node = element;\n node.multiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n }\n}\nfunction postUpdateWrapper(element, props) {\n var node = element;\n var wasMultiple = node._wrapperState.wasMultiple;\n node._wrapperState.wasMultiple = !!props.multiple;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n } else if (wasMultiple !== !!props.multiple) {\n // For simplicity, reapply `defaultValue` if `multiple` is toggled.\n if (props.defaultValue != null) {\n updateOptions(node, !!props.multiple, props.defaultValue, true);\n } else {\n // Revert the select back to its default unselected state.\n updateOptions(node, !!props.multiple, props.multiple ? [] : '', false);\n }\n }\n}\nfunction restoreControlledState$2(element, props) {\n var node = element;\n var value = props.value;\n\n if (value != null) {\n updateOptions(node, !!props.multiple, value, false);\n }\n}\n\nvar didWarnValDefaultVal = false;\n\n/**\n * Implements a host component that allows setting `value`, and\n * `defaultValue`. This differs from the traditional DOM API because value is\n * usually set as PCDATA children.\n *\n * If `value` is not supplied (or null/undefined), user actions that affect the\n * value will trigger updates to the element.\n *\n * If `value` is supplied (and not null/undefined), the rendered element will\n * not trigger updates to the element. Instead, the `value` prop must change in\n * order for the rendered element to be updated.\n *\n * The rendered element will be initialized with an empty value, the prop\n * `defaultValue` if specified, or the children content (deprecated).\n */\nfunction getHostProps$3(element, props) {\n var node = element;\n\n (function () {\n if (!(props.dangerouslySetInnerHTML == null)) {\n {\n throw ReactError(Error(\"`dangerouslySetInnerHTML` does not make sense on .\"));\n }\n }\n })(); // Always set children to the same thing. In IE9, the selection range will\n // get reset if `textContent` is mutated. We could add a check in setTextContent\n // to only set the value if/when the value differs from the node value (which would\n // completely solve this IE9 bug), but Sebastian+Sophie seemed to like this\n // solution. The value can be a boolean or object so that's why it's forced\n // to be a string.\n\n\n var hostProps = _assign({}, props, {\n value: undefined,\n defaultValue: undefined,\n children: toString(node._wrapperState.initialValue)\n });\n\n return hostProps;\n}\nfunction initWrapperState$2(element, props) {\n var node = element;\n\n {\n ReactControlledValuePropTypes.checkPropTypes('textarea', props);\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValDefaultVal) {\n warning$1(false, '%s contains a textarea with both value and defaultValue props. ' + 'Textarea elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled textarea ' + 'and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component');\n didWarnValDefaultVal = true;\n }\n }\n\n var initialValue = props.value; // Only bother fetching default value if we're going to use it\n\n if (initialValue == null) {\n var defaultValue = props.defaultValue; // TODO (yungsters): Remove support for children content in .\n\n var children = props.children;\n\n if (children != null) {\n {\n warning$1(false, 'Use the `defaultValue` or `value` props instead of setting ' + 'children on .');\n }\n\n (function () {\n if (!(defaultValue == null)) {\n {\n throw ReactError(Error(\"If you supply `defaultValue` on a , do not pass children.\"));\n }\n }\n })();\n\n if (Array.isArray(children)) {\n (function () {\n if (!(children.length <= 1)) {\n {\n throw ReactError(Error(\" can only have at most one child.\"));\n }\n }\n })();\n\n children = children[0];\n }\n\n defaultValue = children;\n }\n\n if (defaultValue == null) {\n defaultValue = '';\n }\n\n initialValue = defaultValue;\n }\n\n node._wrapperState = {\n initialValue: getToStringValue(initialValue)\n };\n}\nfunction updateWrapper$1(element, props) {\n var node = element;\n var value = getToStringValue(props.value);\n var defaultValue = getToStringValue(props.defaultValue);\n\n if (value != null) {\n // Cast `value` to a string to ensure the value is set correctly. While\n // browsers typically do this as necessary, jsdom doesn't.\n var newValue = toString(value); // To avoid side effects (such as losing text selection), only set value if changed\n\n if (newValue !== node.value) {\n node.value = newValue;\n }\n\n if (props.defaultValue == null && node.defaultValue !== newValue) {\n node.defaultValue = newValue;\n }\n }\n\n if (defaultValue != null) {\n node.defaultValue = toString(defaultValue);\n }\n}\nfunction postMountWrapper$3(element, props) {\n var node = element; // This is in postMount because we need access to the DOM node, which is not\n // available until after the component has mounted.\n\n var textContent = node.textContent; // Only set node.value if textContent is equal to the expected\n // initial value. In IE10/IE11 there is a bug where the placeholder attribute\n // will populate textContent as well.\n // https://developer.microsoft.com/microsoft-edge/platform/issues/101525/\n\n if (textContent === node._wrapperState.initialValue) {\n if (textContent !== '' && textContent !== null) {\n node.value = textContent;\n }\n }\n}\nfunction restoreControlledState$3(element, props) {\n // DOM component is still mounted; update\n updateWrapper$1(element, props);\n}\n\nvar HTML_NAMESPACE$1 = 'http://www.w3.org/1999/xhtml';\nvar MATH_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\nvar SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\nvar Namespaces = {\n html: HTML_NAMESPACE$1,\n mathml: MATH_NAMESPACE,\n svg: SVG_NAMESPACE\n}; // Assumes there is no parent namespace.\n\nfunction getIntrinsicNamespace(type) {\n switch (type) {\n case 'svg':\n return SVG_NAMESPACE;\n\n case 'math':\n return MATH_NAMESPACE;\n\n default:\n return HTML_NAMESPACE$1;\n }\n}\nfunction getChildNamespace(parentNamespace, type) {\n if (parentNamespace == null || parentNamespace === HTML_NAMESPACE$1) {\n // No (or default) parent namespace: potential entry point.\n return getIntrinsicNamespace(type);\n }\n\n if (parentNamespace === SVG_NAMESPACE && type === 'foreignObject') {\n // We're leaving SVG.\n return HTML_NAMESPACE$1;\n } // By default, pass namespace below.\n\n\n return parentNamespace;\n}\n\n/* globals MSApp */\n\n/**\n * Create a function which has 'unsafe' privileges (required by windows8 apps)\n */\nvar createMicrosoftUnsafeLocalFunction = function (func) {\n if (typeof MSApp !== 'undefined' && MSApp.execUnsafeLocalFunction) {\n return function (arg0, arg1, arg2, arg3) {\n MSApp.execUnsafeLocalFunction(function () {\n return func(arg0, arg1, arg2, arg3);\n });\n };\n } else {\n return func;\n }\n};\n\nvar reusableSVGContainer;\n/**\n * Set the innerHTML property of a node\n *\n * @param {DOMElement} node\n * @param {string} html\n * @internal\n */\n\nvar setInnerHTML = createMicrosoftUnsafeLocalFunction(function (node, html) {\n if (node.namespaceURI === Namespaces.svg) {\n {\n if (enableTrustedTypesIntegration) {\n // TODO: reconsider the text of this warning and when it should show\n // before enabling the feature flag.\n !(typeof trustedTypes === 'undefined') ? warning$1(false, \"Using 'dangerouslySetInnerHTML' in an svg element with \" + 'Trusted Types enabled in an Internet Explorer will cause ' + 'the trusted value to be converted to string. Assigning string ' + \"to 'innerHTML' will throw an error if Trusted Types are enforced. \" + \"You can try to wrap your svg element inside a div and use 'dangerouslySetInnerHTML' \" + 'on the enclosing div instead.') : void 0;\n }\n }\n\n if (!('innerHTML' in node)) {\n // IE does not have innerHTML for SVG nodes, so instead we inject the\n // new markup in a temp node and then move the child nodes across into\n // the target node\n reusableSVGContainer = reusableSVGContainer || document.createElement('div');\n reusableSVGContainer.innerHTML = '' + html.valueOf().toString() + ' ';\n var svgNode = reusableSVGContainer.firstChild;\n\n while (node.firstChild) {\n node.removeChild(node.firstChild);\n }\n\n while (svgNode.firstChild) {\n node.appendChild(svgNode.firstChild);\n }\n\n return;\n }\n }\n\n node.innerHTML = html;\n});\n\n/**\n * HTML nodeType values that represent the type of the node\n */\nvar ELEMENT_NODE = 1;\nvar TEXT_NODE = 3;\nvar COMMENT_NODE = 8;\nvar DOCUMENT_NODE = 9;\nvar DOCUMENT_FRAGMENT_NODE = 11;\n\n/**\n * Set the textContent property of a node. For text updates, it's faster\n * to set the `nodeValue` of the Text node directly instead of using\n * `.textContent` which will remove the existing node and create a new one.\n *\n * @param {DOMElement} node\n * @param {string} text\n * @internal\n */\n\nvar setTextContent = function (node, text) {\n if (text) {\n var firstChild = node.firstChild;\n\n if (firstChild && firstChild === node.lastChild && firstChild.nodeType === TEXT_NODE) {\n firstChild.nodeValue = text;\n return;\n }\n }\n\n node.textContent = text;\n};\n\n// Do not use the below two methods directly!\n// Instead use constants exported from DOMTopLevelEventTypes in ReactDOM.\n// (It is the only module that is allowed to access these methods.)\nfunction unsafeCastStringToDOMTopLevelType(topLevelType) {\n return topLevelType;\n}\nfunction unsafeCastDOMTopLevelTypeToString(topLevelType) {\n return topLevelType;\n}\n\n/**\n * Generate a mapping of standard vendor prefixes using the defined style property and event name.\n *\n * @param {string} styleProp\n * @param {string} eventName\n * @returns {object}\n */\n\nfunction makePrefixMap(styleProp, eventName) {\n var prefixes = {};\n prefixes[styleProp.toLowerCase()] = eventName.toLowerCase();\n prefixes['Webkit' + styleProp] = 'webkit' + eventName;\n prefixes['Moz' + styleProp] = 'moz' + eventName;\n return prefixes;\n}\n/**\n * A list of event names to a configurable list of vendor prefixes.\n */\n\n\nvar vendorPrefixes = {\n animationend: makePrefixMap('Animation', 'AnimationEnd'),\n animationiteration: makePrefixMap('Animation', 'AnimationIteration'),\n animationstart: makePrefixMap('Animation', 'AnimationStart'),\n transitionend: makePrefixMap('Transition', 'TransitionEnd')\n};\n/**\n * Event names that have already been detected and prefixed (if applicable).\n */\n\nvar prefixedEventNames = {};\n/**\n * Element to check for prefixes on.\n */\n\nvar style = {};\n/**\n * Bootstrap if a DOM exists.\n */\n\nif (canUseDOM) {\n style = document.createElement('div').style; // On some platforms, in particular some releases of Android 4.x,\n // the un-prefixed \"animation\" and \"transition\" properties are defined on the\n // style object but the events that fire will still be prefixed, so we need\n // to check if the un-prefixed events are usable, and if not remove them from the map.\n\n if (!('AnimationEvent' in window)) {\n delete vendorPrefixes.animationend.animation;\n delete vendorPrefixes.animationiteration.animation;\n delete vendorPrefixes.animationstart.animation;\n } // Same as above\n\n\n if (!('TransitionEvent' in window)) {\n delete vendorPrefixes.transitionend.transition;\n }\n}\n/**\n * Attempts to determine the correct vendor prefixed event name.\n *\n * @param {string} eventName\n * @returns {string}\n */\n\n\nfunction getVendorPrefixedEventName(eventName) {\n if (prefixedEventNames[eventName]) {\n return prefixedEventNames[eventName];\n } else if (!vendorPrefixes[eventName]) {\n return eventName;\n }\n\n var prefixMap = vendorPrefixes[eventName];\n\n for (var styleProp in prefixMap) {\n if (prefixMap.hasOwnProperty(styleProp) && styleProp in style) {\n return prefixedEventNames[eventName] = prefixMap[styleProp];\n }\n }\n\n return eventName;\n}\n\n/**\n * To identify top level events in ReactDOM, we use constants defined by this\n * module. This is the only module that uses the unsafe* methods to express\n * that the constants actually correspond to the browser event names. This lets\n * us save some bundle size by avoiding a top level type -> event name map.\n * The rest of ReactDOM code should import top level types from this file.\n */\n\nvar TOP_ABORT = unsafeCastStringToDOMTopLevelType('abort');\nvar TOP_ANIMATION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationend'));\nvar TOP_ANIMATION_ITERATION = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationiteration'));\nvar TOP_ANIMATION_START = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('animationstart'));\nvar TOP_BLUR = unsafeCastStringToDOMTopLevelType('blur');\nvar TOP_CAN_PLAY = unsafeCastStringToDOMTopLevelType('canplay');\nvar TOP_CAN_PLAY_THROUGH = unsafeCastStringToDOMTopLevelType('canplaythrough');\nvar TOP_CANCEL = unsafeCastStringToDOMTopLevelType('cancel');\nvar TOP_CHANGE = unsafeCastStringToDOMTopLevelType('change');\nvar TOP_CLICK = unsafeCastStringToDOMTopLevelType('click');\nvar TOP_CLOSE = unsafeCastStringToDOMTopLevelType('close');\nvar TOP_COMPOSITION_END = unsafeCastStringToDOMTopLevelType('compositionend');\nvar TOP_COMPOSITION_START = unsafeCastStringToDOMTopLevelType('compositionstart');\nvar TOP_COMPOSITION_UPDATE = unsafeCastStringToDOMTopLevelType('compositionupdate');\nvar TOP_CONTEXT_MENU = unsafeCastStringToDOMTopLevelType('contextmenu');\nvar TOP_COPY = unsafeCastStringToDOMTopLevelType('copy');\nvar TOP_CUT = unsafeCastStringToDOMTopLevelType('cut');\nvar TOP_DOUBLE_CLICK = unsafeCastStringToDOMTopLevelType('dblclick');\nvar TOP_AUX_CLICK = unsafeCastStringToDOMTopLevelType('auxclick');\nvar TOP_DRAG = unsafeCastStringToDOMTopLevelType('drag');\nvar TOP_DRAG_END = unsafeCastStringToDOMTopLevelType('dragend');\nvar TOP_DRAG_ENTER = unsafeCastStringToDOMTopLevelType('dragenter');\nvar TOP_DRAG_EXIT = unsafeCastStringToDOMTopLevelType('dragexit');\nvar TOP_DRAG_LEAVE = unsafeCastStringToDOMTopLevelType('dragleave');\nvar TOP_DRAG_OVER = unsafeCastStringToDOMTopLevelType('dragover');\nvar TOP_DRAG_START = unsafeCastStringToDOMTopLevelType('dragstart');\nvar TOP_DROP = unsafeCastStringToDOMTopLevelType('drop');\nvar TOP_DURATION_CHANGE = unsafeCastStringToDOMTopLevelType('durationchange');\nvar TOP_EMPTIED = unsafeCastStringToDOMTopLevelType('emptied');\nvar TOP_ENCRYPTED = unsafeCastStringToDOMTopLevelType('encrypted');\nvar TOP_ENDED = unsafeCastStringToDOMTopLevelType('ended');\nvar TOP_ERROR = unsafeCastStringToDOMTopLevelType('error');\nvar TOP_FOCUS = unsafeCastStringToDOMTopLevelType('focus');\nvar TOP_GOT_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('gotpointercapture');\nvar TOP_INPUT = unsafeCastStringToDOMTopLevelType('input');\nvar TOP_INVALID = unsafeCastStringToDOMTopLevelType('invalid');\nvar TOP_KEY_DOWN = unsafeCastStringToDOMTopLevelType('keydown');\nvar TOP_KEY_PRESS = unsafeCastStringToDOMTopLevelType('keypress');\nvar TOP_KEY_UP = unsafeCastStringToDOMTopLevelType('keyup');\nvar TOP_LOAD = unsafeCastStringToDOMTopLevelType('load');\nvar TOP_LOAD_START = unsafeCastStringToDOMTopLevelType('loadstart');\nvar TOP_LOADED_DATA = unsafeCastStringToDOMTopLevelType('loadeddata');\nvar TOP_LOADED_METADATA = unsafeCastStringToDOMTopLevelType('loadedmetadata');\nvar TOP_LOST_POINTER_CAPTURE = unsafeCastStringToDOMTopLevelType('lostpointercapture');\nvar TOP_MOUSE_DOWN = unsafeCastStringToDOMTopLevelType('mousedown');\nvar TOP_MOUSE_MOVE = unsafeCastStringToDOMTopLevelType('mousemove');\nvar TOP_MOUSE_OUT = unsafeCastStringToDOMTopLevelType('mouseout');\nvar TOP_MOUSE_OVER = unsafeCastStringToDOMTopLevelType('mouseover');\nvar TOP_MOUSE_UP = unsafeCastStringToDOMTopLevelType('mouseup');\nvar TOP_PASTE = unsafeCastStringToDOMTopLevelType('paste');\nvar TOP_PAUSE = unsafeCastStringToDOMTopLevelType('pause');\nvar TOP_PLAY = unsafeCastStringToDOMTopLevelType('play');\nvar TOP_PLAYING = unsafeCastStringToDOMTopLevelType('playing');\nvar TOP_POINTER_CANCEL = unsafeCastStringToDOMTopLevelType('pointercancel');\nvar TOP_POINTER_DOWN = unsafeCastStringToDOMTopLevelType('pointerdown');\n\n\nvar TOP_POINTER_MOVE = unsafeCastStringToDOMTopLevelType('pointermove');\nvar TOP_POINTER_OUT = unsafeCastStringToDOMTopLevelType('pointerout');\nvar TOP_POINTER_OVER = unsafeCastStringToDOMTopLevelType('pointerover');\nvar TOP_POINTER_UP = unsafeCastStringToDOMTopLevelType('pointerup');\nvar TOP_PROGRESS = unsafeCastStringToDOMTopLevelType('progress');\nvar TOP_RATE_CHANGE = unsafeCastStringToDOMTopLevelType('ratechange');\nvar TOP_RESET = unsafeCastStringToDOMTopLevelType('reset');\nvar TOP_SCROLL = unsafeCastStringToDOMTopLevelType('scroll');\nvar TOP_SEEKED = unsafeCastStringToDOMTopLevelType('seeked');\nvar TOP_SEEKING = unsafeCastStringToDOMTopLevelType('seeking');\nvar TOP_SELECTION_CHANGE = unsafeCastStringToDOMTopLevelType('selectionchange');\nvar TOP_STALLED = unsafeCastStringToDOMTopLevelType('stalled');\nvar TOP_SUBMIT = unsafeCastStringToDOMTopLevelType('submit');\nvar TOP_SUSPEND = unsafeCastStringToDOMTopLevelType('suspend');\nvar TOP_TEXT_INPUT = unsafeCastStringToDOMTopLevelType('textInput');\nvar TOP_TIME_UPDATE = unsafeCastStringToDOMTopLevelType('timeupdate');\nvar TOP_TOGGLE = unsafeCastStringToDOMTopLevelType('toggle');\nvar TOP_TOUCH_CANCEL = unsafeCastStringToDOMTopLevelType('touchcancel');\nvar TOP_TOUCH_END = unsafeCastStringToDOMTopLevelType('touchend');\nvar TOP_TOUCH_MOVE = unsafeCastStringToDOMTopLevelType('touchmove');\nvar TOP_TOUCH_START = unsafeCastStringToDOMTopLevelType('touchstart');\nvar TOP_TRANSITION_END = unsafeCastStringToDOMTopLevelType(getVendorPrefixedEventName('transitionend'));\nvar TOP_VOLUME_CHANGE = unsafeCastStringToDOMTopLevelType('volumechange');\nvar TOP_WAITING = unsafeCastStringToDOMTopLevelType('waiting');\nvar TOP_WHEEL = unsafeCastStringToDOMTopLevelType('wheel'); // List of events that need to be individually attached to media elements.\n// Note that events in this list will *not* be listened to at the top level\n// unless they're explicitly whitelisted in `ReactBrowserEventEmitter.listenTo`.\n\nvar mediaEventTypes = [TOP_ABORT, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_VOLUME_CHANGE, TOP_WAITING];\nfunction getRawEventName(topLevelType) {\n return unsafeCastDOMTopLevelTypeToString(topLevelType);\n}\n\nvar attemptSynchronousHydration;\nfunction setAttemptSynchronousHydration(fn) {\n attemptSynchronousHydration = fn;\n} // TODO: Upgrade this definition once we're on a newer version of Flow that\n// has this definition built-in.\n\nvar hasScheduledReplayAttempt = false; // The queue of discrete events to be replayed.\n\nvar queuedDiscreteEvents = []; // Indicates if any continuous event targets are non-null for early bailout.\n\n// if the last target was dehydrated.\n\nvar queuedFocus = null;\nvar queuedDrag = null;\nvar queuedMouse = null; // For pointer events there can be one latest event per pointerId.\n\nvar queuedPointers = new Map();\nvar queuedPointerCaptures = new Map(); // We could consider replaying selectionchange and touchmoves too.\n\nfunction hasQueuedDiscreteEvents() {\n return queuedDiscreteEvents.length > 0;\n}\n\nvar discreteReplayableEvents = [TOP_MOUSE_DOWN, TOP_MOUSE_UP, TOP_TOUCH_CANCEL, TOP_TOUCH_END, TOP_TOUCH_START, TOP_AUX_CLICK, TOP_DOUBLE_CLICK, TOP_POINTER_CANCEL, TOP_POINTER_DOWN, TOP_POINTER_UP, TOP_DRAG_END, TOP_DRAG_START, TOP_DROP, TOP_COMPOSITION_END, TOP_COMPOSITION_START, TOP_KEY_DOWN, TOP_KEY_PRESS, TOP_KEY_UP, TOP_INPUT, TOP_TEXT_INPUT, TOP_CLOSE, TOP_CANCEL, TOP_COPY, TOP_CUT, TOP_PASTE, TOP_CLICK, TOP_CHANGE, TOP_CONTEXT_MENU, TOP_RESET, TOP_SUBMIT];\nvar continuousReplayableEvents = [TOP_FOCUS, TOP_BLUR, TOP_DRAG_ENTER, TOP_DRAG_LEAVE, TOP_MOUSE_OVER, TOP_MOUSE_OUT, TOP_POINTER_OVER, TOP_POINTER_OUT, TOP_GOT_POINTER_CAPTURE, TOP_LOST_POINTER_CAPTURE];\nfunction isReplayableDiscreteEvent(eventType) {\n return discreteReplayableEvents.indexOf(eventType) > -1;\n}\n\nfunction trapReplayableEvent(topLevelType, document, listeningSet) {\n listenToTopLevel(topLevelType, document, listeningSet);\n\n if (enableFlareAPI) {\n // Trap events for the responder system.\n var passiveEventKey = unsafeCastDOMTopLevelTypeToString(topLevelType) + '_passive';\n\n if (!listeningSet.has(passiveEventKey)) {\n trapEventForResponderEventSystem(document, topLevelType, true);\n listeningSet.add(passiveEventKey);\n } // TODO: This listens to all events as active which might have\n // undesirable effects. It's also unnecessary to have both\n // passive and active listeners. Instead, we could start with\n // a passive and upgrade it to an active one if needed.\n // For replaying purposes the active is never needed since we\n // currently don't preventDefault.\n\n\n var activeEventKey = unsafeCastDOMTopLevelTypeToString(topLevelType) + '_active';\n\n if (!listeningSet.has(activeEventKey)) {\n trapEventForResponderEventSystem(document, topLevelType, false);\n listeningSet.add(activeEventKey);\n }\n }\n}\n\nfunction eagerlyTrapReplayableEvents(document) {\n var listeningSet = getListeningSetForElement(document); // Discrete\n\n discreteReplayableEvents.forEach(function (topLevelType) {\n trapReplayableEvent(topLevelType, document, listeningSet);\n }); // Continuous\n\n continuousReplayableEvents.forEach(function (topLevelType) {\n trapReplayableEvent(topLevelType, document, listeningSet);\n });\n}\n\nfunction createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {\n return {\n blockedOn: blockedOn,\n topLevelType: topLevelType,\n eventSystemFlags: eventSystemFlags | IS_REPLAYED,\n nativeEvent: nativeEvent\n };\n}\n\nfunction queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {\n var queuedEvent = createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);\n queuedDiscreteEvents.push(queuedEvent);\n\n if (enableSelectiveHydration) {\n if (queuedDiscreteEvents.length === 1) {\n // If this was the first discrete event, we might be able to\n // synchronously unblock it so that preventDefault still works.\n while (queuedEvent.blockedOn !== null) {\n var _fiber = getInstanceFromNode$1(queuedEvent.blockedOn);\n\n if (_fiber === null) {\n break;\n }\n\n attemptSynchronousHydration(_fiber);\n\n if (queuedEvent.blockedOn === null) {\n // We got unblocked by hydration. Let's try again.\n replayUnblockedEvents(); // If we're reblocked, on an inner boundary, we might need\n // to attempt hydrating that one.\n\n continue;\n } else {\n // We're still blocked from hydation, we have to give up\n // and replay later.\n break;\n }\n }\n }\n }\n} // Resets the replaying for this type of continuous event to no event.\n\nfunction clearIfContinuousEvent(topLevelType, nativeEvent) {\n switch (topLevelType) {\n case TOP_FOCUS:\n case TOP_BLUR:\n queuedFocus = null;\n break;\n\n case TOP_DRAG_ENTER:\n case TOP_DRAG_LEAVE:\n queuedDrag = null;\n break;\n\n case TOP_MOUSE_OVER:\n case TOP_MOUSE_OUT:\n queuedMouse = null;\n break;\n\n case TOP_POINTER_OVER:\n case TOP_POINTER_OUT:\n {\n var pointerId = nativeEvent.pointerId;\n queuedPointers.delete(pointerId);\n break;\n }\n\n case TOP_GOT_POINTER_CAPTURE:\n case TOP_LOST_POINTER_CAPTURE:\n {\n var _pointerId = nativeEvent.pointerId;\n queuedPointerCaptures.delete(_pointerId);\n break;\n }\n }\n}\n\nfunction accumulateOrCreateQueuedReplayableEvent(existingQueuedEvent, blockedOn, topLevelType, eventSystemFlags, nativeEvent) {\n if (existingQueuedEvent === null || existingQueuedEvent.nativeEvent !== nativeEvent) {\n return createQueuedReplayableEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);\n } // If we have already queued this exact event, then it's because\n // the different event systems have different DOM event listeners.\n // We can accumulate the flags and store a single event to be\n // replayed.\n\n\n existingQueuedEvent.eventSystemFlags |= eventSystemFlags;\n return existingQueuedEvent;\n}\n\nfunction queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent) {\n // These set relatedTarget to null because the replayed event will be treated as if we\n // moved from outside the window (no target) onto the target once it hydrates.\n // Instead of mutating we could clone the event.\n switch (topLevelType) {\n case TOP_FOCUS:\n {\n var focusEvent = nativeEvent;\n queuedFocus = accumulateOrCreateQueuedReplayableEvent(queuedFocus, blockedOn, topLevelType, eventSystemFlags, focusEvent);\n return true;\n }\n\n case TOP_DRAG_ENTER:\n {\n var dragEvent = nativeEvent;\n queuedDrag = accumulateOrCreateQueuedReplayableEvent(queuedDrag, blockedOn, topLevelType, eventSystemFlags, dragEvent);\n return true;\n }\n\n case TOP_MOUSE_OVER:\n {\n var mouseEvent = nativeEvent;\n queuedMouse = accumulateOrCreateQueuedReplayableEvent(queuedMouse, blockedOn, topLevelType, eventSystemFlags, mouseEvent);\n return true;\n }\n\n case TOP_POINTER_OVER:\n {\n var pointerEvent = nativeEvent;\n var pointerId = pointerEvent.pointerId;\n queuedPointers.set(pointerId, accumulateOrCreateQueuedReplayableEvent(queuedPointers.get(pointerId) || null, blockedOn, topLevelType, eventSystemFlags, pointerEvent));\n return true;\n }\n\n case TOP_GOT_POINTER_CAPTURE:\n {\n var _pointerEvent = nativeEvent;\n var _pointerId2 = _pointerEvent.pointerId;\n queuedPointerCaptures.set(_pointerId2, accumulateOrCreateQueuedReplayableEvent(queuedPointerCaptures.get(_pointerId2) || null, blockedOn, topLevelType, eventSystemFlags, _pointerEvent));\n return true;\n }\n }\n\n return false;\n}\n\nfunction attemptReplayQueuedEvent(queuedEvent) {\n if (queuedEvent.blockedOn !== null) {\n return false;\n }\n\n var nextBlockedOn = attemptToDispatchEvent(queuedEvent.topLevelType, queuedEvent.eventSystemFlags, queuedEvent.nativeEvent);\n\n if (nextBlockedOn !== null) {\n // We're still blocked. Try again later.\n queuedEvent.blockedOn = nextBlockedOn;\n return false;\n }\n\n return true;\n}\n\nfunction attemptReplayQueuedEventInMap(queuedEvent, key, map) {\n if (attemptReplayQueuedEvent(queuedEvent)) {\n map.delete(key);\n }\n}\n\nfunction replayUnblockedEvents() {\n hasScheduledReplayAttempt = false; // First replay discrete events.\n\n while (queuedDiscreteEvents.length > 0) {\n var nextDiscreteEvent = queuedDiscreteEvents[0];\n\n if (nextDiscreteEvent.blockedOn !== null) {\n // We're still blocked.\n break;\n }\n\n var nextBlockedOn = attemptToDispatchEvent(nextDiscreteEvent.topLevelType, nextDiscreteEvent.eventSystemFlags, nextDiscreteEvent.nativeEvent);\n\n if (nextBlockedOn !== null) {\n // We're still blocked. Try again later.\n nextDiscreteEvent.blockedOn = nextBlockedOn;\n } else {\n // We've successfully replayed the first event. Let's try the next one.\n queuedDiscreteEvents.shift();\n }\n } // Next replay any continuous events.\n\n\n if (queuedFocus !== null && attemptReplayQueuedEvent(queuedFocus)) {\n queuedFocus = null;\n }\n\n if (queuedDrag !== null && attemptReplayQueuedEvent(queuedDrag)) {\n queuedDrag = null;\n }\n\n if (queuedMouse !== null && attemptReplayQueuedEvent(queuedMouse)) {\n queuedMouse = null;\n }\n\n queuedPointers.forEach(attemptReplayQueuedEventInMap);\n queuedPointerCaptures.forEach(attemptReplayQueuedEventInMap);\n}\n\nfunction scheduleCallbackIfUnblocked(queuedEvent, unblocked) {\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n\n if (!hasScheduledReplayAttempt) {\n hasScheduledReplayAttempt = true; // Schedule a callback to attempt replaying as many events as are\n // now unblocked. This first might not actually be unblocked yet.\n // We could check it early to avoid scheduling an unnecessary callback.\n\n Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, replayUnblockedEvents);\n }\n }\n}\n\nfunction retryIfBlockedOn(unblocked) {\n // Mark anything that was blocked on this as no longer blocked\n // and eligible for a replay.\n if (queuedDiscreteEvents.length > 0) {\n scheduleCallbackIfUnblocked(queuedDiscreteEvents[0], unblocked); // This is a exponential search for each boundary that commits. I think it's\n // worth it because we expect very few discrete events to queue up and once\n // we are actually fully unblocked it will be fast to replay them.\n\n for (var i = 1; i < queuedDiscreteEvents.length; i++) {\n var queuedEvent = queuedDiscreteEvents[i];\n\n if (queuedEvent.blockedOn === unblocked) {\n queuedEvent.blockedOn = null;\n }\n }\n }\n\n if (queuedFocus !== null) {\n scheduleCallbackIfUnblocked(queuedFocus, unblocked);\n }\n\n if (queuedDrag !== null) {\n scheduleCallbackIfUnblocked(queuedDrag, unblocked);\n }\n\n if (queuedMouse !== null) {\n scheduleCallbackIfUnblocked(queuedMouse, unblocked);\n }\n\n var unblock = function (queuedEvent) {\n return scheduleCallbackIfUnblocked(queuedEvent, unblocked);\n };\n\n queuedPointers.forEach(unblock);\n queuedPointerCaptures.forEach(unblock);\n}\n\n/**\n * `ReactInstanceMap` maintains a mapping from a public facing stateful\n * instance (key) and the internal representation (value). This allows public\n * methods to accept the user facing instance as an argument and map them back\n * to internal methods.\n *\n * Note that this module is currently shared and assumed to be stateless.\n * If this becomes an actual Map, that will break.\n */\n\n/**\n * This API should be called `delete` but we'd have to make sure to always\n * transform these to strings for IE support. When this transform is fully\n * supported we can rename it.\n */\n\nfunction get(key) {\n return key._reactInternalFiber;\n}\nfunction has(key) {\n return key._reactInternalFiber !== undefined;\n}\nfunction set(key, value) {\n key._reactInternalFiber = value;\n}\n\n// Don't change these two values. They're used by React Dev Tools.\nvar NoEffect =\n/* */\n0;\nvar PerformedWork =\n/* */\n1; // You can change the rest (and add more).\n\nvar Placement =\n/* */\n2;\nvar Update =\n/* */\n4;\nvar PlacementAndUpdate =\n/* */\n6;\nvar Deletion =\n/* */\n8;\nvar ContentReset =\n/* */\n16;\nvar Callback =\n/* */\n32;\nvar DidCapture =\n/* */\n64;\nvar Ref =\n/* */\n128;\nvar Snapshot =\n/* */\n256;\nvar Passive =\n/* */\n512;\nvar Hydrating =\n/* */\n1024;\nvar HydratingAndUpdate =\n/* */\n1028; // Passive & Update & Callback & Ref & Snapshot\n\nvar LifecycleEffectMask =\n/* */\n932; // Union of all host effects\n\nvar HostEffectMask =\n/* */\n2047;\nvar Incomplete =\n/* */\n2048;\nvar ShouldCapture =\n/* */\n4096;\n\nvar ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;\nfunction getNearestMountedFiber(fiber) {\n var node = fiber;\n var nearestMounted = fiber;\n\n if (!fiber.alternate) {\n // If there is no alternate, this might be a new tree that isn't inserted\n // yet. If it is, then it will have a pending insertion effect on it.\n var nextNode = node;\n\n do {\n node = nextNode;\n\n if ((node.effectTag & (Placement | Hydrating)) !== NoEffect) {\n // This is an insertion or in-progress hydration. The nearest possible\n // mounted fiber is the parent but we need to continue to figure out\n // if that one is still mounted.\n nearestMounted = node.return;\n }\n\n nextNode = node.return;\n } while (nextNode);\n } else {\n while (node.return) {\n node = node.return;\n }\n }\n\n if (node.tag === HostRoot) {\n // TODO: Check if this was a nested HostRoot when used with\n // renderContainerIntoSubtree.\n return nearestMounted;\n } // If we didn't hit the root, that means that we're in an disconnected tree\n // that has been unmounted.\n\n\n return null;\n}\nfunction getSuspenseInstanceFromFiber(fiber) {\n if (fiber.tag === SuspenseComponent) {\n var suspenseState = fiber.memoizedState;\n\n if (suspenseState === null) {\n var current = fiber.alternate;\n\n if (current !== null) {\n suspenseState = current.memoizedState;\n }\n }\n\n if (suspenseState !== null) {\n return suspenseState.dehydrated;\n }\n }\n\n return null;\n}\nfunction getContainerFromFiber(fiber) {\n return fiber.tag === HostRoot ? fiber.stateNode.containerInfo : null;\n}\nfunction isFiberMounted(fiber) {\n return getNearestMountedFiber(fiber) === fiber;\n}\nfunction isMounted(component) {\n {\n var owner = ReactCurrentOwner$1.current;\n\n if (owner !== null && owner.tag === ClassComponent) {\n var ownerFiber = owner;\n var instance = ownerFiber.stateNode;\n !instance._warnedAboutRefsInRender ? warningWithoutStack$1(false, '%s is accessing isMounted inside its render() function. ' + 'render() should be a pure function of props and state. It should ' + 'never access something that requires stale data from the previous ' + 'render, such as refs. Move this logic to componentDidMount and ' + 'componentDidUpdate instead.', getComponentName(ownerFiber.type) || 'A component') : void 0;\n instance._warnedAboutRefsInRender = true;\n }\n }\n\n var fiber = get(component);\n\n if (!fiber) {\n return false;\n }\n\n return getNearestMountedFiber(fiber) === fiber;\n}\n\nfunction assertIsMounted(fiber) {\n (function () {\n if (!(getNearestMountedFiber(fiber) === fiber)) {\n {\n throw ReactError(Error(\"Unable to find node on an unmounted component.\"));\n }\n }\n })();\n}\n\nfunction findCurrentFiberUsingSlowPath(fiber) {\n var alternate = fiber.alternate;\n\n if (!alternate) {\n // If there is no alternate, then we only need to check if it is mounted.\n var nearestMounted = getNearestMountedFiber(fiber);\n\n (function () {\n if (!(nearestMounted !== null)) {\n {\n throw ReactError(Error(\"Unable to find node on an unmounted component.\"));\n }\n }\n })();\n\n if (nearestMounted !== fiber) {\n return null;\n }\n\n return fiber;\n } // If we have two possible branches, we'll walk backwards up to the root\n // to see what path the root points to. On the way we may hit one of the\n // special cases and we'll deal with them.\n\n\n var a = fiber;\n var b = alternate;\n\n while (true) {\n var parentA = a.return;\n\n if (parentA === null) {\n // We're at the root.\n break;\n }\n\n var parentB = parentA.alternate;\n\n if (parentB === null) {\n // There is no alternate. This is an unusual case. Currently, it only\n // happens when a Suspense component is hidden. An extra fragment fiber\n // is inserted in between the Suspense fiber and its children. Skip\n // over this extra fragment fiber and proceed to the next parent.\n var nextParent = parentA.return;\n\n if (nextParent !== null) {\n a = b = nextParent;\n continue;\n } // If there's no parent, we're at the root.\n\n\n break;\n } // If both copies of the parent fiber point to the same child, we can\n // assume that the child is current. This happens when we bailout on low\n // priority: the bailed out fiber's child reuses the current child.\n\n\n if (parentA.child === parentB.child) {\n var child = parentA.child;\n\n while (child) {\n if (child === a) {\n // We've determined that A is the current branch.\n assertIsMounted(parentA);\n return fiber;\n }\n\n if (child === b) {\n // We've determined that B is the current branch.\n assertIsMounted(parentA);\n return alternate;\n }\n\n child = child.sibling;\n } // We should never have an alternate for any mounting node. So the only\n // way this could possibly happen is if this was unmounted, if at all.\n\n\n (function () {\n {\n {\n throw ReactError(Error(\"Unable to find node on an unmounted component.\"));\n }\n }\n })();\n }\n\n if (a.return !== b.return) {\n // The return pointer of A and the return pointer of B point to different\n // fibers. We assume that return pointers never criss-cross, so A must\n // belong to the child set of A.return, and B must belong to the child\n // set of B.return.\n a = parentA;\n b = parentB;\n } else {\n // The return pointers point to the same fiber. We'll have to use the\n // default, slow path: scan the child sets of each parent alternate to see\n // which child belongs to which set.\n //\n // Search parent A's child set\n var didFindChild = false;\n var _child = parentA.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentA;\n b = parentB;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentA;\n a = parentB;\n break;\n }\n\n _child = _child.sibling;\n }\n\n if (!didFindChild) {\n // Search parent B's child set\n _child = parentB.child;\n\n while (_child) {\n if (_child === a) {\n didFindChild = true;\n a = parentB;\n b = parentA;\n break;\n }\n\n if (_child === b) {\n didFindChild = true;\n b = parentB;\n a = parentA;\n break;\n }\n\n _child = _child.sibling;\n }\n\n (function () {\n if (!didFindChild) {\n {\n throw ReactError(Error(\"Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.\"));\n }\n }\n })();\n }\n }\n\n (function () {\n if (!(a.alternate === b)) {\n {\n throw ReactError(Error(\"Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.\"));\n }\n }\n })();\n } // If the root is not a host container, we're in a disconnected tree. I.e.\n // unmounted.\n\n\n (function () {\n if (!(a.tag === HostRoot)) {\n {\n throw ReactError(Error(\"Unable to find node on an unmounted component.\"));\n }\n }\n })();\n\n if (a.stateNode.current === a) {\n // We've determined that A is the current branch.\n return fiber;\n } // Otherwise B has to be current branch.\n\n\n return alternate;\n}\nfunction findCurrentHostFiber(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n\n if (!currentParent) {\n return null;\n } // Next we'll drill down this component to find the first HostComponent/Text.\n\n\n var node = currentParent;\n\n while (true) {\n if (node.tag === HostComponent || node.tag === HostText) {\n return node;\n } else if (node.child) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === currentParent) {\n return null;\n }\n\n while (!node.sibling) {\n if (!node.return || node.return === currentParent) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n } // Flow needs the return null here, but ESLint complains about it.\n // eslint-disable-next-line no-unreachable\n\n\n return null;\n}\nfunction findCurrentHostFiberWithNoPortals(parent) {\n var currentParent = findCurrentFiberUsingSlowPath(parent);\n\n if (!currentParent) {\n return null;\n } // Next we'll drill down this component to find the first HostComponent/Text.\n\n\n var node = currentParent;\n\n while (true) {\n if (node.tag === HostComponent || node.tag === HostText || enableFundamentalAPI && node.tag === FundamentalComponent) {\n return node;\n } else if (node.child && node.tag !== HostPortal) {\n node.child.return = node;\n node = node.child;\n continue;\n }\n\n if (node === currentParent) {\n return null;\n }\n\n while (!node.sibling) {\n if (!node.return || node.return === currentParent) {\n return null;\n }\n\n node = node.return;\n }\n\n node.sibling.return = node.return;\n node = node.sibling;\n } // Flow needs the return null here, but ESLint complains about it.\n // eslint-disable-next-line no-unreachable\n\n\n return null;\n}\n\nfunction addEventBubbleListener(element, eventType, listener) {\n element.addEventListener(eventType, listener, false);\n}\nfunction addEventCaptureListener(element, eventType, listener) {\n element.addEventListener(eventType, listener, true);\n}\nfunction addEventCaptureListenerWithPassiveFlag(element, eventType, listener, passive) {\n element.addEventListener(eventType, listener, {\n capture: true,\n passive: passive\n });\n}\n\n/**\n * Gets the target node from a native browser event by accounting for\n * inconsistencies in browser DOM APIs.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {DOMEventTarget} Target node.\n */\n\nfunction getEventTarget(nativeEvent) {\n // Fallback to nativeEvent.srcElement for IE9\n // https://github.com/facebook/react/issues/12506\n var target = nativeEvent.target || nativeEvent.srcElement || window; // Normalize SVG element events #4963\n\n if (target.correspondingUseElement) {\n target = target.correspondingUseElement;\n } // Safari may fire events on text nodes (Node.TEXT_NODE is 3).\n // @see http://www.quirksmode.org/js/events_properties.html\n\n\n return target.nodeType === TEXT_NODE ? target.parentNode : target;\n}\n\nfunction getParent(inst) {\n do {\n inst = inst.return; // TODO: If this is a HostRoot we might want to bail out.\n // That is depending on if we want nested subtrees (layers) to bubble\n // events to their parent. We could also go through parentNode on the\n // host node but that wouldn't work for React Native and doesn't let us\n // do the portal feature.\n } while (inst && inst.tag !== HostComponent);\n\n if (inst) {\n return inst;\n }\n\n return null;\n}\n/**\n * Return the lowest common ancestor of A and B, or null if they are in\n * different trees.\n */\n\n\nfunction getLowestCommonAncestor(instA, instB) {\n var depthA = 0;\n\n for (var tempA = instA; tempA; tempA = getParent(tempA)) {\n depthA++;\n }\n\n var depthB = 0;\n\n for (var tempB = instB; tempB; tempB = getParent(tempB)) {\n depthB++;\n } // If A is deeper, crawl up.\n\n\n while (depthA - depthB > 0) {\n instA = getParent(instA);\n depthA--;\n } // If B is deeper, crawl up.\n\n\n while (depthB - depthA > 0) {\n instB = getParent(instB);\n depthB--;\n } // Walk in lockstep until we find a match.\n\n\n var depth = depthA;\n\n while (depth--) {\n if (instA === instB || instA === instB.alternate) {\n return instA;\n }\n\n instA = getParent(instA);\n instB = getParent(instB);\n }\n\n return null;\n}\n/**\n * Return if A is an ancestor of B.\n */\n\n\n/**\n * Return the parent instance of the passed-in instance.\n */\n\n\n/**\n * Simulates the traversal of a two-phase, capture/bubble event dispatch.\n */\n\nfunction traverseTwoPhase(inst, fn, arg) {\n var path = [];\n\n while (inst) {\n path.push(inst);\n inst = getParent(inst);\n }\n\n var i;\n\n for (i = path.length; i-- > 0;) {\n fn(path[i], 'captured', arg);\n }\n\n for (i = 0; i < path.length; i++) {\n fn(path[i], 'bubbled', arg);\n }\n}\n/**\n * Traverses the ID hierarchy and invokes the supplied `cb` on any IDs that\n * should would receive a `mouseEnter` or `mouseLeave` event.\n *\n * Does not invoke the callback on the nearest common ancestor because nothing\n * \"entered\" or \"left\" that element.\n */\n\nfunction traverseEnterLeave(from, to, fn, argFrom, argTo) {\n var common = from && to ? getLowestCommonAncestor(from, to) : null;\n var pathFrom = [];\n\n while (true) {\n if (!from) {\n break;\n }\n\n if (from === common) {\n break;\n }\n\n var alternate = from.alternate;\n\n if (alternate !== null && alternate === common) {\n break;\n }\n\n pathFrom.push(from);\n from = getParent(from);\n }\n\n var pathTo = [];\n\n while (true) {\n if (!to) {\n break;\n }\n\n if (to === common) {\n break;\n }\n\n var _alternate = to.alternate;\n\n if (_alternate !== null && _alternate === common) {\n break;\n }\n\n pathTo.push(to);\n to = getParent(to);\n }\n\n for (var i = 0; i < pathFrom.length; i++) {\n fn(pathFrom[i], 'bubbled', argFrom);\n }\n\n for (var _i = pathTo.length; _i-- > 0;) {\n fn(pathTo[_i], 'captured', argTo);\n }\n}\n\n/**\n * Some event types have a notion of different registration names for different\n * \"phases\" of propagation. This finds listeners by a given phase.\n */\nfunction listenerAtPhase(inst, event, propagationPhase) {\n var registrationName = event.dispatchConfig.phasedRegistrationNames[propagationPhase];\n return getListener(inst, registrationName);\n}\n/**\n * A small set of propagation patterns, each of which will accept a small amount\n * of information, and generate a set of \"dispatch ready event objects\" - which\n * are sets of events that have already been annotated with a set of dispatched\n * listener functions/ids. The API is designed this way to discourage these\n * propagation strategies from actually executing the dispatches, since we\n * always want to collect the entire set of dispatches before executing even a\n * single one.\n */\n\n/**\n * Tags a `SyntheticEvent` with dispatched listeners. Creating this function\n * here, allows us to not have to bind or create functions for each event.\n * Mutating the event's members allows us to not have to create a wrapping\n * \"dispatch\" object that pairs the event with the listener.\n */\n\n\nfunction accumulateDirectionalDispatches(inst, phase, event) {\n {\n !inst ? warningWithoutStack$1(false, 'Dispatching inst must not be null') : void 0;\n }\n\n var listener = listenerAtPhase(inst, event, phase);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n}\n/**\n * Collect dispatches (must be entirely collected before dispatching - see unit\n * tests). Lazily allocate the array to conserve memory. We must loop through\n * each event and perform the traversal for each one. We cannot perform a\n * single traversal for the entire collection of events because each event may\n * have a different target.\n */\n\n\nfunction accumulateTwoPhaseDispatchesSingle(event) {\n if (event && event.dispatchConfig.phasedRegistrationNames) {\n traverseTwoPhase(event._targetInst, accumulateDirectionalDispatches, event);\n }\n}\n/**\n * Accumulates without regard to direction, does not look for phased\n * registration names. Same as `accumulateDirectDispatchesSingle` but without\n * requiring that the `dispatchMarker` be the same as the dispatched ID.\n */\n\n\nfunction accumulateDispatches(inst, ignoredDirection, event) {\n if (inst && event && event.dispatchConfig.registrationName) {\n var registrationName = event.dispatchConfig.registrationName;\n var listener = getListener(inst, registrationName);\n\n if (listener) {\n event._dispatchListeners = accumulateInto(event._dispatchListeners, listener);\n event._dispatchInstances = accumulateInto(event._dispatchInstances, inst);\n }\n }\n}\n/**\n * Accumulates dispatches on an `SyntheticEvent`, but only for the\n * `dispatchMarker`.\n * @param {SyntheticEvent} event\n */\n\n\nfunction accumulateDirectDispatchesSingle(event) {\n if (event && event.dispatchConfig.registrationName) {\n accumulateDispatches(event._targetInst, null, event);\n }\n}\n\nfunction accumulateTwoPhaseDispatches(events) {\n forEachAccumulated(events, accumulateTwoPhaseDispatchesSingle);\n}\n\nfunction accumulateEnterLeaveDispatches(leave, enter, from, to) {\n traverseEnterLeave(from, to, accumulateDispatches, leave, enter);\n}\nfunction accumulateDirectDispatches(events) {\n forEachAccumulated(events, accumulateDirectDispatchesSingle);\n}\n\n/* eslint valid-typeof: 0 */\nvar EVENT_POOL_SIZE = 10;\n/**\n * @interface Event\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar EventInterface = {\n type: null,\n target: null,\n // currentTarget is set when dispatching; no use in copying it here\n currentTarget: function () {\n return null;\n },\n eventPhase: null,\n bubbles: null,\n cancelable: null,\n timeStamp: function (event) {\n return event.timeStamp || Date.now();\n },\n defaultPrevented: null,\n isTrusted: null\n};\n\nfunction functionThatReturnsTrue() {\n return true;\n}\n\nfunction functionThatReturnsFalse() {\n return false;\n}\n/**\n * Synthetic events are dispatched by event plugins, typically in response to a\n * top-level event delegation handler.\n *\n * These systems should generally use pooling to reduce the frequency of garbage\n * collection. The system should check `isPersistent` to determine whether the\n * event should be released into the pool after being dispatched. Users that\n * need a persisted event should invoke `persist`.\n *\n * Synthetic events (and subclasses) implement the DOM Level 3 Events API by\n * normalizing browser quirks. Subclasses do not necessarily have to implement a\n * DOM interface; custom application-specific events can also subclass this.\n *\n * @param {object} dispatchConfig Configuration used to dispatch this event.\n * @param {*} targetInst Marker identifying the event target.\n * @param {object} nativeEvent Native browser event.\n * @param {DOMEventTarget} nativeEventTarget Target node.\n */\n\n\nfunction SyntheticEvent(dispatchConfig, targetInst, nativeEvent, nativeEventTarget) {\n {\n // these have a getter/setter for warnings\n delete this.nativeEvent;\n delete this.preventDefault;\n delete this.stopPropagation;\n delete this.isDefaultPrevented;\n delete this.isPropagationStopped;\n }\n\n this.dispatchConfig = dispatchConfig;\n this._targetInst = targetInst;\n this.nativeEvent = nativeEvent;\n var Interface = this.constructor.Interface;\n\n for (var propName in Interface) {\n if (!Interface.hasOwnProperty(propName)) {\n continue;\n }\n\n {\n delete this[propName]; // this has a getter/setter for warnings\n }\n\n var normalize = Interface[propName];\n\n if (normalize) {\n this[propName] = normalize(nativeEvent);\n } else {\n if (propName === 'target') {\n this.target = nativeEventTarget;\n } else {\n this[propName] = nativeEvent[propName];\n }\n }\n }\n\n var defaultPrevented = nativeEvent.defaultPrevented != null ? nativeEvent.defaultPrevented : nativeEvent.returnValue === false;\n\n if (defaultPrevented) {\n this.isDefaultPrevented = functionThatReturnsTrue;\n } else {\n this.isDefaultPrevented = functionThatReturnsFalse;\n }\n\n this.isPropagationStopped = functionThatReturnsFalse;\n return this;\n}\n\n_assign(SyntheticEvent.prototype, {\n preventDefault: function () {\n this.defaultPrevented = true;\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.preventDefault) {\n event.preventDefault();\n } else if (typeof event.returnValue !== 'unknown') {\n event.returnValue = false;\n }\n\n this.isDefaultPrevented = functionThatReturnsTrue;\n },\n stopPropagation: function () {\n var event = this.nativeEvent;\n\n if (!event) {\n return;\n }\n\n if (event.stopPropagation) {\n event.stopPropagation();\n } else if (typeof event.cancelBubble !== 'unknown') {\n // The ChangeEventPlugin registers a \"propertychange\" event for\n // IE. This event does not support bubbling or cancelling, and\n // any references to cancelBubble throw \"Member not found\". A\n // typeof check of \"unknown\" circumvents this issue (and is also\n // IE specific).\n event.cancelBubble = true;\n }\n\n this.isPropagationStopped = functionThatReturnsTrue;\n },\n\n /**\n * We release all dispatched `SyntheticEvent`s after each event loop, adding\n * them back into the pool. This allows a way to hold onto a reference that\n * won't be added back into the pool.\n */\n persist: function () {\n this.isPersistent = functionThatReturnsTrue;\n },\n\n /**\n * Checks if this event should be released back into the pool.\n *\n * @return {boolean} True if this should not be released, false otherwise.\n */\n isPersistent: functionThatReturnsFalse,\n\n /**\n * `PooledClass` looks for `destructor` on each instance it releases.\n */\n destructor: function () {\n var Interface = this.constructor.Interface;\n\n for (var propName in Interface) {\n {\n Object.defineProperty(this, propName, getPooledWarningPropertyDefinition(propName, Interface[propName]));\n }\n }\n\n this.dispatchConfig = null;\n this._targetInst = null;\n this.nativeEvent = null;\n this.isDefaultPrevented = functionThatReturnsFalse;\n this.isPropagationStopped = functionThatReturnsFalse;\n this._dispatchListeners = null;\n this._dispatchInstances = null;\n\n {\n Object.defineProperty(this, 'nativeEvent', getPooledWarningPropertyDefinition('nativeEvent', null));\n Object.defineProperty(this, 'isDefaultPrevented', getPooledWarningPropertyDefinition('isDefaultPrevented', functionThatReturnsFalse));\n Object.defineProperty(this, 'isPropagationStopped', getPooledWarningPropertyDefinition('isPropagationStopped', functionThatReturnsFalse));\n Object.defineProperty(this, 'preventDefault', getPooledWarningPropertyDefinition('preventDefault', function () {}));\n Object.defineProperty(this, 'stopPropagation', getPooledWarningPropertyDefinition('stopPropagation', function () {}));\n }\n }\n});\n\nSyntheticEvent.Interface = EventInterface;\n/**\n * Helper to reduce boilerplate when creating subclasses.\n */\n\nSyntheticEvent.extend = function (Interface) {\n var Super = this;\n\n var E = function () {};\n\n E.prototype = Super.prototype;\n var prototype = new E();\n\n function Class() {\n return Super.apply(this, arguments);\n }\n\n _assign(prototype, Class.prototype);\n\n Class.prototype = prototype;\n Class.prototype.constructor = Class;\n Class.Interface = _assign({}, Super.Interface, Interface);\n Class.extend = Super.extend;\n addEventPoolingTo(Class);\n return Class;\n};\n\naddEventPoolingTo(SyntheticEvent);\n/**\n * Helper to nullify syntheticEvent instance properties when destructing\n *\n * @param {String} propName\n * @param {?object} getVal\n * @return {object} defineProperty object\n */\n\nfunction getPooledWarningPropertyDefinition(propName, getVal) {\n var isFunction = typeof getVal === 'function';\n return {\n configurable: true,\n set: set,\n get: get\n };\n\n function set(val) {\n var action = isFunction ? 'setting the method' : 'setting the property';\n warn(action, 'This is effectively a no-op');\n return val;\n }\n\n function get() {\n var action = isFunction ? 'accessing the method' : 'accessing the property';\n var result = isFunction ? 'This is a no-op function' : 'This is set to null';\n warn(action, result);\n return getVal;\n }\n\n function warn(action, result) {\n var warningCondition = false;\n !warningCondition ? warningWithoutStack$1(false, \"This synthetic event is reused for performance reasons. If you're seeing this, \" + \"you're %s `%s` on a released/nullified synthetic event. %s. \" + 'If you must keep the original synthetic event around, use event.persist(). ' + 'See https://fb.me/react-event-pooling for more information.', action, propName, result) : void 0;\n }\n}\n\nfunction getPooledEvent(dispatchConfig, targetInst, nativeEvent, nativeInst) {\n var EventConstructor = this;\n\n if (EventConstructor.eventPool.length) {\n var instance = EventConstructor.eventPool.pop();\n EventConstructor.call(instance, dispatchConfig, targetInst, nativeEvent, nativeInst);\n return instance;\n }\n\n return new EventConstructor(dispatchConfig, targetInst, nativeEvent, nativeInst);\n}\n\nfunction releasePooledEvent(event) {\n var EventConstructor = this;\n\n (function () {\n if (!(event instanceof EventConstructor)) {\n {\n throw ReactError(Error(\"Trying to release an event instance into a pool of a different type.\"));\n }\n }\n })();\n\n event.destructor();\n\n if (EventConstructor.eventPool.length < EVENT_POOL_SIZE) {\n EventConstructor.eventPool.push(event);\n }\n}\n\nfunction addEventPoolingTo(EventConstructor) {\n EventConstructor.eventPool = [];\n EventConstructor.getPooled = getPooledEvent;\n EventConstructor.release = releasePooledEvent;\n}\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/css3-animations/#AnimationEvent-interface\n * @see https://developer.mozilla.org/en-US/docs/Web/API/AnimationEvent\n */\n\nvar SyntheticAnimationEvent = SyntheticEvent.extend({\n animationName: null,\n elapsedTime: null,\n pseudoElement: null\n});\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/clipboard-apis/\n */\n\nvar SyntheticClipboardEvent = SyntheticEvent.extend({\n clipboardData: function (event) {\n return 'clipboardData' in event ? event.clipboardData : window.clipboardData;\n }\n});\n\nvar SyntheticUIEvent = SyntheticEvent.extend({\n view: null,\n detail: null\n});\n\n/**\n * @interface FocusEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticFocusEvent = SyntheticUIEvent.extend({\n relatedTarget: null\n});\n\n/**\n * `charCode` represents the actual \"character code\" and is safe to use with\n * `String.fromCharCode`. As such, only keys that correspond to printable\n * characters produce a valid `charCode`, the only exception to this is Enter.\n * The Tab-key is considered non-printable and does not have a `charCode`,\n * presumably because it does not produce a tab-character in browsers.\n *\n * @param {object} nativeEvent Native browser event.\n * @return {number} Normalized `charCode` property.\n */\nfunction getEventCharCode(nativeEvent) {\n var charCode;\n var keyCode = nativeEvent.keyCode;\n\n if ('charCode' in nativeEvent) {\n charCode = nativeEvent.charCode; // FF does not set `charCode` for the Enter-key, check against `keyCode`.\n\n if (charCode === 0 && keyCode === 13) {\n charCode = 13;\n }\n } else {\n // IE8 does not implement `charCode`, but `keyCode` has the correct value.\n charCode = keyCode;\n } // IE and Edge (on Windows) and Chrome / Safari (on Windows and Linux)\n // report Enter as charCode 10 when ctrl is pressed.\n\n\n if (charCode === 10) {\n charCode = 13;\n } // Some non-printable keys are reported in `charCode`/`keyCode`, discard them.\n // Must not discard the (non-)printable Enter-key.\n\n\n if (charCode >= 32 || charCode === 13) {\n return charCode;\n }\n\n return 0;\n}\n\n/**\n * Normalization of deprecated HTML5 `key` values\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\n\nvar normalizeKey = {\n Esc: 'Escape',\n Spacebar: ' ',\n Left: 'ArrowLeft',\n Up: 'ArrowUp',\n Right: 'ArrowRight',\n Down: 'ArrowDown',\n Del: 'Delete',\n Win: 'OS',\n Menu: 'ContextMenu',\n Apps: 'ContextMenu',\n Scroll: 'ScrollLock',\n MozPrintableKey: 'Unidentified'\n};\n/**\n * Translation from legacy `keyCode` to HTML5 `key`\n * Only special keys supported, all others depend on keyboard layout or browser\n * @see https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent#Key_names\n */\n\nvar translateToKey = {\n '8': 'Backspace',\n '9': 'Tab',\n '12': 'Clear',\n '13': 'Enter',\n '16': 'Shift',\n '17': 'Control',\n '18': 'Alt',\n '19': 'Pause',\n '20': 'CapsLock',\n '27': 'Escape',\n '32': ' ',\n '33': 'PageUp',\n '34': 'PageDown',\n '35': 'End',\n '36': 'Home',\n '37': 'ArrowLeft',\n '38': 'ArrowUp',\n '39': 'ArrowRight',\n '40': 'ArrowDown',\n '45': 'Insert',\n '46': 'Delete',\n '112': 'F1',\n '113': 'F2',\n '114': 'F3',\n '115': 'F4',\n '116': 'F5',\n '117': 'F6',\n '118': 'F7',\n '119': 'F8',\n '120': 'F9',\n '121': 'F10',\n '122': 'F11',\n '123': 'F12',\n '144': 'NumLock',\n '145': 'ScrollLock',\n '224': 'Meta'\n};\n/**\n * @param {object} nativeEvent Native browser event.\n * @return {string} Normalized `key` property.\n */\n\nfunction getEventKey(nativeEvent) {\n if (nativeEvent.key) {\n // Normalize inconsistent values reported by browsers due to\n // implementations of a working draft specification.\n // FireFox implements `key` but returns `MozPrintableKey` for all\n // printable characters (normalized to `Unidentified`), ignore it.\n var key = normalizeKey[nativeEvent.key] || nativeEvent.key;\n\n if (key !== 'Unidentified') {\n return key;\n }\n } // Browser does not implement `key`, polyfill as much of it as we can.\n\n\n if (nativeEvent.type === 'keypress') {\n var charCode = getEventCharCode(nativeEvent); // The enter-key is technically both printable and non-printable and can\n // thus be captured by `keypress`, no other non-printable key should.\n\n return charCode === 13 ? 'Enter' : String.fromCharCode(charCode);\n }\n\n if (nativeEvent.type === 'keydown' || nativeEvent.type === 'keyup') {\n // While user keyboard layout determines the actual meaning of each\n // `keyCode` value, almost all function keys have a universal value.\n return translateToKey[nativeEvent.keyCode] || 'Unidentified';\n }\n\n return '';\n}\n\n/**\n * Translation from modifier key to the associated property in the event.\n * @see http://www.w3.org/TR/DOM-Level-3-Events/#keys-Modifiers\n */\nvar modifierKeyToProp = {\n Alt: 'altKey',\n Control: 'ctrlKey',\n Meta: 'metaKey',\n Shift: 'shiftKey'\n}; // Older browsers (Safari <= 10, iOS Safari <= 10.2) do not support\n// getModifierState. If getModifierState is not supported, we map it to a set of\n// modifier keys exposed by the event. In this case, Lock-keys are not supported.\n\nfunction modifierStateGetter(keyArg) {\n var syntheticEvent = this;\n var nativeEvent = syntheticEvent.nativeEvent;\n\n if (nativeEvent.getModifierState) {\n return nativeEvent.getModifierState(keyArg);\n }\n\n var keyProp = modifierKeyToProp[keyArg];\n return keyProp ? !!nativeEvent[keyProp] : false;\n}\n\nfunction getEventModifierState(nativeEvent) {\n return modifierStateGetter;\n}\n\n/**\n * @interface KeyboardEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticKeyboardEvent = SyntheticUIEvent.extend({\n key: getEventKey,\n location: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n repeat: null,\n locale: null,\n getModifierState: getEventModifierState,\n // Legacy Interface\n charCode: function (event) {\n // `charCode` is the result of a KeyPress event and represents the value of\n // the actual printable character.\n // KeyPress is deprecated, but its replacement is not yet final and not\n // implemented in any major browser. Only KeyPress has charCode.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n return 0;\n },\n keyCode: function (event) {\n // `keyCode` is the result of a KeyDown/Up event and represents the value of\n // physical keyboard key.\n // The actual meaning of the value depends on the users' keyboard layout\n // which cannot be detected. Assuming that it is a US keyboard layout\n // provides a surprisingly accurate mapping for US and European users.\n // Due to this, it is left to the user to implement at this time.\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n },\n which: function (event) {\n // `which` is an alias for either `keyCode` or `charCode` depending on the\n // type of the event.\n if (event.type === 'keypress') {\n return getEventCharCode(event);\n }\n\n if (event.type === 'keydown' || event.type === 'keyup') {\n return event.keyCode;\n }\n\n return 0;\n }\n});\n\nvar previousScreenX = 0;\nvar previousScreenY = 0; // Use flags to signal movementX/Y has already been set\n\nvar isMovementXSet = false;\nvar isMovementYSet = false;\n/**\n * @interface MouseEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticMouseEvent = SyntheticUIEvent.extend({\n screenX: null,\n screenY: null,\n clientX: null,\n clientY: null,\n pageX: null,\n pageY: null,\n ctrlKey: null,\n shiftKey: null,\n altKey: null,\n metaKey: null,\n getModifierState: getEventModifierState,\n button: null,\n buttons: null,\n relatedTarget: function (event) {\n return event.relatedTarget || (event.fromElement === event.srcElement ? event.toElement : event.fromElement);\n },\n movementX: function (event) {\n if ('movementX' in event) {\n return event.movementX;\n }\n\n var screenX = previousScreenX;\n previousScreenX = event.screenX;\n\n if (!isMovementXSet) {\n isMovementXSet = true;\n return 0;\n }\n\n return event.type === 'mousemove' ? event.screenX - screenX : 0;\n },\n movementY: function (event) {\n if ('movementY' in event) {\n return event.movementY;\n }\n\n var screenY = previousScreenY;\n previousScreenY = event.screenY;\n\n if (!isMovementYSet) {\n isMovementYSet = true;\n return 0;\n }\n\n return event.type === 'mousemove' ? event.screenY - screenY : 0;\n }\n});\n\n/**\n * @interface PointerEvent\n * @see http://www.w3.org/TR/pointerevents/\n */\n\nvar SyntheticPointerEvent = SyntheticMouseEvent.extend({\n pointerId: null,\n width: null,\n height: null,\n pressure: null,\n tangentialPressure: null,\n tiltX: null,\n tiltY: null,\n twist: null,\n pointerType: null,\n isPrimary: null\n});\n\n/**\n * @interface DragEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticDragEvent = SyntheticMouseEvent.extend({\n dataTransfer: null\n});\n\n/**\n * @interface TouchEvent\n * @see http://www.w3.org/TR/touch-events/\n */\n\nvar SyntheticTouchEvent = SyntheticUIEvent.extend({\n touches: null,\n targetTouches: null,\n changedTouches: null,\n altKey: null,\n metaKey: null,\n ctrlKey: null,\n shiftKey: null,\n getModifierState: getEventModifierState\n});\n\n/**\n * @interface Event\n * @see http://www.w3.org/TR/2009/WD-css3-transitions-20090320/#transition-events-\n * @see https://developer.mozilla.org/en-US/docs/Web/API/TransitionEvent\n */\n\nvar SyntheticTransitionEvent = SyntheticEvent.extend({\n propertyName: null,\n elapsedTime: null,\n pseudoElement: null\n});\n\n/**\n * @interface WheelEvent\n * @see http://www.w3.org/TR/DOM-Level-3-Events/\n */\n\nvar SyntheticWheelEvent = SyntheticMouseEvent.extend({\n deltaX: function (event) {\n return 'deltaX' in event ? event.deltaX : // Fallback to `wheelDeltaX` for Webkit and normalize (right is positive).\n 'wheelDeltaX' in event ? -event.wheelDeltaX : 0;\n },\n deltaY: function (event) {\n return 'deltaY' in event ? event.deltaY : // Fallback to `wheelDeltaY` for Webkit and normalize (down is positive).\n 'wheelDeltaY' in event ? -event.wheelDeltaY : // Fallback to `wheelDelta` for IE<9 and normalize (down is positive).\n 'wheelDelta' in event ? -event.wheelDelta : 0;\n },\n deltaZ: null,\n // Browsers without \"deltaMode\" is reporting in raw wheel delta where one\n // notch on the scroll is always +/- 120, roughly equivalent to pixels.\n // A good approximation of DOM_DELTA_LINE (1) is 5% of viewport size or\n // ~40 pixels, for DOM_DELTA_SCREEN (2) it is 87.5% of viewport size.\n deltaMode: null\n});\n\n/**\n * Turns\n * ['abort', ...]\n * into\n * eventTypes = {\n * 'abort': {\n * phasedRegistrationNames: {\n * bubbled: 'onAbort',\n * captured: 'onAbortCapture',\n * },\n * dependencies: [TOP_ABORT],\n * },\n * ...\n * };\n * topLevelEventsToDispatchConfig = new Map([\n * [TOP_ABORT, { sameConfig }],\n * ]);\n */\n\nvar eventTuples = [// Discrete events\n[TOP_BLUR, 'blur', DiscreteEvent], [TOP_CANCEL, 'cancel', DiscreteEvent], [TOP_CLICK, 'click', DiscreteEvent], [TOP_CLOSE, 'close', DiscreteEvent], [TOP_CONTEXT_MENU, 'contextMenu', DiscreteEvent], [TOP_COPY, 'copy', DiscreteEvent], [TOP_CUT, 'cut', DiscreteEvent], [TOP_AUX_CLICK, 'auxClick', DiscreteEvent], [TOP_DOUBLE_CLICK, 'doubleClick', DiscreteEvent], [TOP_DRAG_END, 'dragEnd', DiscreteEvent], [TOP_DRAG_START, 'dragStart', DiscreteEvent], [TOP_DROP, 'drop', DiscreteEvent], [TOP_FOCUS, 'focus', DiscreteEvent], [TOP_INPUT, 'input', DiscreteEvent], [TOP_INVALID, 'invalid', DiscreteEvent], [TOP_KEY_DOWN, 'keyDown', DiscreteEvent], [TOP_KEY_PRESS, 'keyPress', DiscreteEvent], [TOP_KEY_UP, 'keyUp', DiscreteEvent], [TOP_MOUSE_DOWN, 'mouseDown', DiscreteEvent], [TOP_MOUSE_UP, 'mouseUp', DiscreteEvent], [TOP_PASTE, 'paste', DiscreteEvent], [TOP_PAUSE, 'pause', DiscreteEvent], [TOP_PLAY, 'play', DiscreteEvent], [TOP_POINTER_CANCEL, 'pointerCancel', DiscreteEvent], [TOP_POINTER_DOWN, 'pointerDown', DiscreteEvent], [TOP_POINTER_UP, 'pointerUp', DiscreteEvent], [TOP_RATE_CHANGE, 'rateChange', DiscreteEvent], [TOP_RESET, 'reset', DiscreteEvent], [TOP_SEEKED, 'seeked', DiscreteEvent], [TOP_SUBMIT, 'submit', DiscreteEvent], [TOP_TOUCH_CANCEL, 'touchCancel', DiscreteEvent], [TOP_TOUCH_END, 'touchEnd', DiscreteEvent], [TOP_TOUCH_START, 'touchStart', DiscreteEvent], [TOP_VOLUME_CHANGE, 'volumeChange', DiscreteEvent], // User-blocking events\n[TOP_DRAG, 'drag', UserBlockingEvent], [TOP_DRAG_ENTER, 'dragEnter', UserBlockingEvent], [TOP_DRAG_EXIT, 'dragExit', UserBlockingEvent], [TOP_DRAG_LEAVE, 'dragLeave', UserBlockingEvent], [TOP_DRAG_OVER, 'dragOver', UserBlockingEvent], [TOP_MOUSE_MOVE, 'mouseMove', UserBlockingEvent], [TOP_MOUSE_OUT, 'mouseOut', UserBlockingEvent], [TOP_MOUSE_OVER, 'mouseOver', UserBlockingEvent], [TOP_POINTER_MOVE, 'pointerMove', UserBlockingEvent], [TOP_POINTER_OUT, 'pointerOut', UserBlockingEvent], [TOP_POINTER_OVER, 'pointerOver', UserBlockingEvent], [TOP_SCROLL, 'scroll', UserBlockingEvent], [TOP_TOGGLE, 'toggle', UserBlockingEvent], [TOP_TOUCH_MOVE, 'touchMove', UserBlockingEvent], [TOP_WHEEL, 'wheel', UserBlockingEvent], // Continuous events\n[TOP_ABORT, 'abort', ContinuousEvent], [TOP_ANIMATION_END, 'animationEnd', ContinuousEvent], [TOP_ANIMATION_ITERATION, 'animationIteration', ContinuousEvent], [TOP_ANIMATION_START, 'animationStart', ContinuousEvent], [TOP_CAN_PLAY, 'canPlay', ContinuousEvent], [TOP_CAN_PLAY_THROUGH, 'canPlayThrough', ContinuousEvent], [TOP_DURATION_CHANGE, 'durationChange', ContinuousEvent], [TOP_EMPTIED, 'emptied', ContinuousEvent], [TOP_ENCRYPTED, 'encrypted', ContinuousEvent], [TOP_ENDED, 'ended', ContinuousEvent], [TOP_ERROR, 'error', ContinuousEvent], [TOP_GOT_POINTER_CAPTURE, 'gotPointerCapture', ContinuousEvent], [TOP_LOAD, 'load', ContinuousEvent], [TOP_LOADED_DATA, 'loadedData', ContinuousEvent], [TOP_LOADED_METADATA, 'loadedMetadata', ContinuousEvent], [TOP_LOAD_START, 'loadStart', ContinuousEvent], [TOP_LOST_POINTER_CAPTURE, 'lostPointerCapture', ContinuousEvent], [TOP_PLAYING, 'playing', ContinuousEvent], [TOP_PROGRESS, 'progress', ContinuousEvent], [TOP_SEEKING, 'seeking', ContinuousEvent], [TOP_STALLED, 'stalled', ContinuousEvent], [TOP_SUSPEND, 'suspend', ContinuousEvent], [TOP_TIME_UPDATE, 'timeUpdate', ContinuousEvent], [TOP_TRANSITION_END, 'transitionEnd', ContinuousEvent], [TOP_WAITING, 'waiting', ContinuousEvent]];\nvar eventTypes = {};\nvar topLevelEventsToDispatchConfig = {};\n\nfor (var i = 0; i < eventTuples.length; i++) {\n var eventTuple = eventTuples[i];\n var topEvent = eventTuple[0];\n var event = eventTuple[1];\n var eventPriority = eventTuple[2];\n var capitalizedEvent = event[0].toUpperCase() + event.slice(1);\n var onEvent = 'on' + capitalizedEvent;\n var config = {\n phasedRegistrationNames: {\n bubbled: onEvent,\n captured: onEvent + 'Capture'\n },\n dependencies: [topEvent],\n eventPriority: eventPriority\n };\n eventTypes[event] = config;\n topLevelEventsToDispatchConfig[topEvent] = config;\n} // Only used in DEV for exhaustiveness validation.\n\n\nvar knownHTMLTopLevelTypes = [TOP_ABORT, TOP_CANCEL, TOP_CAN_PLAY, TOP_CAN_PLAY_THROUGH, TOP_CLOSE, TOP_DURATION_CHANGE, TOP_EMPTIED, TOP_ENCRYPTED, TOP_ENDED, TOP_ERROR, TOP_INPUT, TOP_INVALID, TOP_LOAD, TOP_LOADED_DATA, TOP_LOADED_METADATA, TOP_LOAD_START, TOP_PAUSE, TOP_PLAY, TOP_PLAYING, TOP_PROGRESS, TOP_RATE_CHANGE, TOP_RESET, TOP_SEEKED, TOP_SEEKING, TOP_STALLED, TOP_SUBMIT, TOP_SUSPEND, TOP_TIME_UPDATE, TOP_TOGGLE, TOP_VOLUME_CHANGE, TOP_WAITING];\nvar SimpleEventPlugin = {\n eventTypes: eventTypes,\n getEventPriority: function (topLevelType) {\n var config = topLevelEventsToDispatchConfig[topLevelType];\n return config !== undefined ? config.eventPriority : ContinuousEvent;\n },\n extractEvents: function (topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var dispatchConfig = topLevelEventsToDispatchConfig[topLevelType];\n\n if (!dispatchConfig) {\n return null;\n }\n\n var EventConstructor;\n\n switch (topLevelType) {\n case TOP_KEY_PRESS:\n // Firefox creates a keypress event for function keys too. This removes\n // the unwanted keypress events. Enter is however both printable and\n // non-printable. One would expect Tab to be as well (but it isn't).\n if (getEventCharCode(nativeEvent) === 0) {\n return null;\n }\n\n /* falls through */\n\n case TOP_KEY_DOWN:\n case TOP_KEY_UP:\n EventConstructor = SyntheticKeyboardEvent;\n break;\n\n case TOP_BLUR:\n case TOP_FOCUS:\n EventConstructor = SyntheticFocusEvent;\n break;\n\n case TOP_CLICK:\n // Firefox creates a click event on right mouse clicks. This removes the\n // unwanted click events.\n if (nativeEvent.button === 2) {\n return null;\n }\n\n /* falls through */\n\n case TOP_AUX_CLICK:\n case TOP_DOUBLE_CLICK:\n case TOP_MOUSE_DOWN:\n case TOP_MOUSE_MOVE:\n case TOP_MOUSE_UP: // TODO: Disabled elements should not respond to mouse events\n\n /* falls through */\n\n case TOP_MOUSE_OUT:\n case TOP_MOUSE_OVER:\n case TOP_CONTEXT_MENU:\n EventConstructor = SyntheticMouseEvent;\n break;\n\n case TOP_DRAG:\n case TOP_DRAG_END:\n case TOP_DRAG_ENTER:\n case TOP_DRAG_EXIT:\n case TOP_DRAG_LEAVE:\n case TOP_DRAG_OVER:\n case TOP_DRAG_START:\n case TOP_DROP:\n EventConstructor = SyntheticDragEvent;\n break;\n\n case TOP_TOUCH_CANCEL:\n case TOP_TOUCH_END:\n case TOP_TOUCH_MOVE:\n case TOP_TOUCH_START:\n EventConstructor = SyntheticTouchEvent;\n break;\n\n case TOP_ANIMATION_END:\n case TOP_ANIMATION_ITERATION:\n case TOP_ANIMATION_START:\n EventConstructor = SyntheticAnimationEvent;\n break;\n\n case TOP_TRANSITION_END:\n EventConstructor = SyntheticTransitionEvent;\n break;\n\n case TOP_SCROLL:\n EventConstructor = SyntheticUIEvent;\n break;\n\n case TOP_WHEEL:\n EventConstructor = SyntheticWheelEvent;\n break;\n\n case TOP_COPY:\n case TOP_CUT:\n case TOP_PASTE:\n EventConstructor = SyntheticClipboardEvent;\n break;\n\n case TOP_GOT_POINTER_CAPTURE:\n case TOP_LOST_POINTER_CAPTURE:\n case TOP_POINTER_CANCEL:\n case TOP_POINTER_DOWN:\n case TOP_POINTER_MOVE:\n case TOP_POINTER_OUT:\n case TOP_POINTER_OVER:\n case TOP_POINTER_UP:\n EventConstructor = SyntheticPointerEvent;\n break;\n\n default:\n {\n if (knownHTMLTopLevelTypes.indexOf(topLevelType) === -1) {\n warningWithoutStack$1(false, 'SimpleEventPlugin: Unhandled event type, `%s`. This warning ' + 'is likely caused by a bug in React. Please file an issue.', topLevelType);\n }\n } // HTML Events\n // @see http://www.w3.org/TR/html5/index.html#events-0\n\n\n EventConstructor = SyntheticEvent;\n break;\n }\n\n var event = EventConstructor.getPooled(dispatchConfig, targetInst, nativeEvent, nativeEventTarget);\n accumulateTwoPhaseDispatches(event);\n return event;\n }\n};\n\nvar passiveBrowserEventsSupported = false; // Check if browser support events with passive listeners\n// https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#Safely_detecting_option_support\n\nif (enableFlareAPI && canUseDOM) {\n try {\n var options = {}; // $FlowFixMe: Ignore Flow complaining about needing a value\n\n Object.defineProperty(options, 'passive', {\n get: function () {\n passiveBrowserEventsSupported = true;\n }\n });\n window.addEventListener('test', options, options);\n window.removeEventListener('test', options, options);\n } catch (e) {\n passiveBrowserEventsSupported = false;\n }\n}\n\n// Intentionally not named imports because Rollup would use dynamic dispatch for\n// CommonJS interop named imports.\nvar UserBlockingPriority$1 = Scheduler.unstable_UserBlockingPriority;\nvar runWithPriority$1 = Scheduler.unstable_runWithPriority;\nvar getEventPriority = SimpleEventPlugin.getEventPriority;\nvar CALLBACK_BOOKKEEPING_POOL_SIZE = 10;\nvar callbackBookkeepingPool = [];\n\n/**\n * Find the deepest React component completely containing the root of the\n * passed-in instance (for use when entire React trees are nested within each\n * other). If React trees are not nested, returns null.\n */\nfunction findRootContainerNode(inst) {\n if (inst.tag === HostRoot) {\n return inst.stateNode.containerInfo;\n } // TODO: It may be a good idea to cache this to prevent unnecessary DOM\n // traversal, but caching is difficult to do correctly without using a\n // mutation observer to listen for all DOM changes.\n\n\n while (inst.return) {\n inst = inst.return;\n }\n\n if (inst.tag !== HostRoot) {\n // This can happen if we're in a detached tree.\n return null;\n }\n\n return inst.stateNode.containerInfo;\n} // Used to store ancestor hierarchy in top level callback\n\n\nfunction getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags) {\n if (callbackBookkeepingPool.length) {\n var instance = callbackBookkeepingPool.pop();\n instance.topLevelType = topLevelType;\n instance.eventSystemFlags = eventSystemFlags;\n instance.nativeEvent = nativeEvent;\n instance.targetInst = targetInst;\n return instance;\n }\n\n return {\n topLevelType: topLevelType,\n eventSystemFlags: eventSystemFlags,\n nativeEvent: nativeEvent,\n targetInst: targetInst,\n ancestors: []\n };\n}\n\nfunction releaseTopLevelCallbackBookKeeping(instance) {\n instance.topLevelType = null;\n instance.nativeEvent = null;\n instance.targetInst = null;\n instance.ancestors.length = 0;\n\n if (callbackBookkeepingPool.length < CALLBACK_BOOKKEEPING_POOL_SIZE) {\n callbackBookkeepingPool.push(instance);\n }\n}\n\nfunction handleTopLevel(bookKeeping) {\n var targetInst = bookKeeping.targetInst; // Loop through the hierarchy, in case there's any nested components.\n // It's important that we build the array of ancestors before calling any\n // event handlers, because event handlers can modify the DOM, leading to\n // inconsistencies with ReactMount's node cache. See #1105.\n\n var ancestor = targetInst;\n\n do {\n if (!ancestor) {\n var ancestors = bookKeeping.ancestors;\n ancestors.push(ancestor);\n break;\n }\n\n var root = findRootContainerNode(ancestor);\n\n if (!root) {\n break;\n }\n\n var tag = ancestor.tag;\n\n if (tag === HostComponent || tag === HostText) {\n bookKeeping.ancestors.push(ancestor);\n }\n\n ancestor = getClosestInstanceFromNode(root);\n } while (ancestor);\n\n for (var i = 0; i < bookKeeping.ancestors.length; i++) {\n targetInst = bookKeeping.ancestors[i];\n var eventTarget = getEventTarget(bookKeeping.nativeEvent);\n var topLevelType = bookKeeping.topLevelType;\n var nativeEvent = bookKeeping.nativeEvent;\n runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, eventTarget, bookKeeping.eventSystemFlags);\n }\n} // TODO: can we stop exporting these?\n\n\nvar _enabled = true;\nfunction setEnabled(enabled) {\n _enabled = !!enabled;\n}\nfunction isEnabled() {\n return _enabled;\n}\nfunction trapBubbledEvent(topLevelType, element) {\n trapEventForPluginEventSystem(element, topLevelType, false);\n}\nfunction trapCapturedEvent(topLevelType, element) {\n trapEventForPluginEventSystem(element, topLevelType, true);\n}\nfunction trapEventForResponderEventSystem(element, topLevelType, passive) {\n if (enableFlareAPI) {\n var rawEventName = getRawEventName(topLevelType);\n var eventFlags = RESPONDER_EVENT_SYSTEM; // If passive option is not supported, then the event will be\n // active and not passive, but we flag it as using not being\n // supported too. This way the responder event plugins know,\n // and can provide polyfills if needed.\n\n if (passive) {\n if (passiveBrowserEventsSupported) {\n eventFlags |= IS_PASSIVE;\n } else {\n eventFlags |= IS_ACTIVE;\n eventFlags |= PASSIVE_NOT_SUPPORTED;\n passive = false;\n }\n } else {\n eventFlags |= IS_ACTIVE;\n } // Check if interactive and wrap in discreteUpdates\n\n\n var listener = dispatchEvent.bind(null, topLevelType, eventFlags);\n\n if (passiveBrowserEventsSupported) {\n addEventCaptureListenerWithPassiveFlag(element, rawEventName, listener, passive);\n } else {\n addEventCaptureListener(element, rawEventName, listener);\n }\n }\n}\n\nfunction trapEventForPluginEventSystem(element, topLevelType, capture) {\n var listener;\n\n switch (getEventPriority(topLevelType)) {\n case DiscreteEvent:\n listener = dispatchDiscreteEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);\n break;\n\n case UserBlockingEvent:\n listener = dispatchUserBlockingUpdate.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);\n break;\n\n case ContinuousEvent:\n default:\n listener = dispatchEvent.bind(null, topLevelType, PLUGIN_EVENT_SYSTEM);\n break;\n }\n\n var rawEventName = getRawEventName(topLevelType);\n\n if (capture) {\n addEventCaptureListener(element, rawEventName, listener);\n } else {\n addEventBubbleListener(element, rawEventName, listener);\n }\n}\n\nfunction dispatchDiscreteEvent(topLevelType, eventSystemFlags, nativeEvent) {\n flushDiscreteUpdatesIfNeeded(nativeEvent.timeStamp);\n discreteUpdates(dispatchEvent, topLevelType, eventSystemFlags, nativeEvent);\n}\n\nfunction dispatchUserBlockingUpdate(topLevelType, eventSystemFlags, nativeEvent) {\n if (enableUserBlockingEvents) {\n runWithPriority$1(UserBlockingPriority$1, dispatchEvent.bind(null, topLevelType, eventSystemFlags, nativeEvent));\n } else {\n dispatchEvent(topLevelType, eventSystemFlags, nativeEvent);\n }\n}\n\nfunction dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst) {\n var bookKeeping = getTopLevelCallbackBookKeeping(topLevelType, nativeEvent, targetInst, eventSystemFlags);\n\n try {\n // Event queue being processed in the same cycle allows\n // `preventDefault`.\n batchedEventUpdates(handleTopLevel, bookKeeping);\n } finally {\n releaseTopLevelCallbackBookKeeping(bookKeeping);\n }\n}\n\nfunction dispatchEvent(topLevelType, eventSystemFlags, nativeEvent) {\n if (!_enabled) {\n return;\n }\n\n if (hasQueuedDiscreteEvents() && isReplayableDiscreteEvent(topLevelType)) {\n // If we already have a queue of discrete events, and this is another discrete\n // event, then we can't dispatch it regardless of its target, since they\n // need to dispatch in order.\n queueDiscreteEvent(null, // Flags that we're not actually blocked on anything as far as we know.\n topLevelType, eventSystemFlags, nativeEvent);\n return;\n }\n\n var blockedOn = attemptToDispatchEvent(topLevelType, eventSystemFlags, nativeEvent);\n\n if (blockedOn === null) {\n // We successfully dispatched this event.\n clearIfContinuousEvent(topLevelType, nativeEvent);\n return;\n }\n\n if (isReplayableDiscreteEvent(topLevelType)) {\n // This this to be replayed later once the target is available.\n queueDiscreteEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent);\n return;\n }\n\n if (queueIfContinuousEvent(blockedOn, topLevelType, eventSystemFlags, nativeEvent)) {\n return;\n } // We need to clear only if we didn't queue because\n // queueing is accummulative.\n\n\n clearIfContinuousEvent(topLevelType, nativeEvent); // This is not replayable so we'll invoke it but without a target,\n // in case the event system needs to trace it.\n\n if (enableFlareAPI) {\n if (eventSystemFlags & PLUGIN_EVENT_SYSTEM) {\n dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);\n }\n\n if (eventSystemFlags & RESPONDER_EVENT_SYSTEM) {\n // React Flare event system\n dispatchEventForResponderEventSystem(topLevelType, null, nativeEvent, getEventTarget(nativeEvent), eventSystemFlags);\n }\n } else {\n dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, null);\n }\n} // Attempt dispatching an event. Returns a SuspenseInstance or Container if it's blocked.\n\nfunction attemptToDispatchEvent(topLevelType, eventSystemFlags, nativeEvent) {\n // TODO: Warn if _enabled is false.\n var nativeEventTarget = getEventTarget(nativeEvent);\n var targetInst = getClosestInstanceFromNode(nativeEventTarget);\n\n if (targetInst !== null) {\n var nearestMounted = getNearestMountedFiber(targetInst);\n\n if (nearestMounted === null) {\n // This tree has been unmounted already. Dispatch without a target.\n targetInst = null;\n } else {\n var tag = nearestMounted.tag;\n\n if (tag === SuspenseComponent) {\n var instance = getSuspenseInstanceFromFiber(nearestMounted);\n\n if (instance !== null) {\n // Queue the event to be replayed later. Abort dispatching since we\n // don't want this event dispatched twice through the event system.\n // TODO: If this is the first discrete event in the queue. Schedule an increased\n // priority for this boundary.\n return instance;\n } // This shouldn't happen, something went wrong but to avoid blocking\n // the whole system, dispatch the event without a target.\n // TODO: Warn.\n\n\n targetInst = null;\n } else if (tag === HostRoot) {\n var root = nearestMounted.stateNode;\n\n if (root.hydrate) {\n // If this happens during a replay something went wrong and it might block\n // the whole system.\n return getContainerFromFiber(nearestMounted);\n }\n\n targetInst = null;\n } else if (nearestMounted !== targetInst) {\n // If we get an event (ex: img onload) before committing that\n // component's mount, ignore it for now (that is, treat it as if it was an\n // event on a non-React tree). We might also consider queueing events and\n // dispatching them after the mount.\n targetInst = null;\n }\n }\n }\n\n if (enableFlareAPI) {\n if (eventSystemFlags & PLUGIN_EVENT_SYSTEM) {\n dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);\n }\n\n if (eventSystemFlags & RESPONDER_EVENT_SYSTEM) {\n // React Flare event system\n dispatchEventForResponderEventSystem(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n }\n } else {\n dispatchEventForPluginEventSystem(topLevelType, eventSystemFlags, nativeEvent, targetInst);\n } // We're not blocked on anything.\n\n\n return null;\n}\n\n/**\n * Checks if an event is supported in the current execution environment.\n *\n * NOTE: This will not work correctly for non-generic events such as `change`,\n * `reset`, `load`, `error`, and `select`.\n *\n * Borrows from Modernizr.\n *\n * @param {string} eventNameSuffix Event name, e.g. \"click\".\n * @return {boolean} True if the event is supported.\n * @internal\n * @license Modernizr 3.0.0pre (Custom Build) | MIT\n */\n\nfunction isEventSupported(eventNameSuffix) {\n if (!canUseDOM) {\n return false;\n }\n\n var eventName = 'on' + eventNameSuffix;\n var isSupported = eventName in document;\n\n if (!isSupported) {\n var element = document.createElement('div');\n element.setAttribute(eventName, 'return;');\n isSupported = typeof element[eventName] === 'function';\n }\n\n return isSupported;\n}\n\n/**\n * Summary of `ReactBrowserEventEmitter` event handling:\n *\n * - Top-level delegation is used to trap most native browser events. This\n * may only occur in the main thread and is the responsibility of\n * ReactDOMEventListener, which is injected and can therefore support\n * pluggable event sources. This is the only work that occurs in the main\n * thread.\n *\n * - We normalize and de-duplicate events to account for browser quirks. This\n * may be done in the worker thread.\n *\n * - Forward these native events (with the associated top-level type used to\n * trap it) to `EventPluginHub`, which in turn will ask plugins if they want\n * to extract any synthetic events.\n *\n * - The `EventPluginHub` will then process each event by annotating them with\n * \"dispatches\", a sequence of listeners and IDs that care about that event.\n *\n * - The `EventPluginHub` then dispatches the events.\n *\n * Overview of React and the event system:\n *\n * +------------+ .\n * | DOM | .\n * +------------+ .\n * | .\n * v .\n * +------------+ .\n * | ReactEvent | .\n * | Listener | .\n * +------------+ . +-----------+\n * | . +--------+|SimpleEvent|\n * | . | |Plugin |\n * +-----|------+ . v +-----------+\n * | | | . +--------------+ +------------+\n * | +-----------.--->|EventPluginHub| | Event |\n * | | . | | +-----------+ | Propagators|\n * | ReactEvent | . | | |TapEvent | |------------|\n * | Emitter | . | |<---+|Plugin | |other plugin|\n * | | . | | +-----------+ | utilities |\n * | +-----------.--->| | +------------+\n * | | | . +--------------+\n * +-----|------+ . ^ +-----------+\n * | . | |Enter/Leave|\n * + . +-------+|Plugin |\n * +-------------+ . +-----------+\n * | application | .\n * |-------------| .\n * | | .\n * | | .\n * +-------------+ .\n * .\n * React Core . General Purpose Event Plugin System\n */\n\nvar PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;\nvar elementListeningSets = new PossiblyWeakMap();\nfunction getListeningSetForElement(element) {\n var listeningSet = elementListeningSets.get(element);\n\n if (listeningSet === undefined) {\n listeningSet = new Set();\n elementListeningSets.set(element, listeningSet);\n }\n\n return listeningSet;\n}\n/**\n * We listen for bubbled touch events on the document object.\n *\n * Firefox v8.01 (and possibly others) exhibited strange behavior when\n * mounting `onmousemove` events at some node that was not the document\n * element. The symptoms were that if your mouse is not moving over something\n * contained within that mount point (for example on the background) the\n * top-level listeners for `onmousemove` won't be called. However, if you\n * register the `mousemove` on the document object, then it will of course\n * catch all `mousemove`s. This along with iOS quirks, justifies restricting\n * top-level listeners to the document object only, at least for these\n * movement types of events and possibly all events.\n *\n * @see http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n *\n * Also, `keyup`/`keypress`/`keydown` do not bubble to the window on IE, but\n * they bubble to document.\n *\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @param {object} mountAt Container where to mount the listener\n */\n\nfunction listenTo(registrationName, mountAt) {\n var listeningSet = getListeningSetForElement(mountAt);\n var dependencies = registrationNameDependencies[registrationName];\n\n for (var i = 0; i < dependencies.length; i++) {\n var dependency = dependencies[i];\n listenToTopLevel(dependency, mountAt, listeningSet);\n }\n}\nfunction listenToTopLevel(topLevelType, mountAt, listeningSet) {\n if (!listeningSet.has(topLevelType)) {\n switch (topLevelType) {\n case TOP_SCROLL:\n trapCapturedEvent(TOP_SCROLL, mountAt);\n break;\n\n case TOP_FOCUS:\n case TOP_BLUR:\n trapCapturedEvent(TOP_FOCUS, mountAt);\n trapCapturedEvent(TOP_BLUR, mountAt); // We set the flag for a single dependency later in this function,\n // but this ensures we mark both as attached rather than just one.\n\n listeningSet.add(TOP_BLUR);\n listeningSet.add(TOP_FOCUS);\n break;\n\n case TOP_CANCEL:\n case TOP_CLOSE:\n if (isEventSupported(getRawEventName(topLevelType))) {\n trapCapturedEvent(topLevelType, mountAt);\n }\n\n break;\n\n case TOP_INVALID:\n case TOP_SUBMIT:\n case TOP_RESET:\n // We listen to them on the target DOM elements.\n // Some of them bubble so we don't want them to fire twice.\n break;\n\n default:\n // By default, listen on the top level to all non-media events.\n // Media events don't bubble so adding the listener wouldn't do anything.\n var isMediaEvent = mediaEventTypes.indexOf(topLevelType) !== -1;\n\n if (!isMediaEvent) {\n trapBubbledEvent(topLevelType, mountAt);\n }\n\n break;\n }\n\n listeningSet.add(topLevelType);\n }\n}\nfunction isListeningToAllDependencies(registrationName, mountAt) {\n var listeningSet = getListeningSetForElement(mountAt);\n var dependencies = registrationNameDependencies[registrationName];\n\n for (var i = 0; i < dependencies.length; i++) {\n var dependency = dependencies[i];\n\n if (!listeningSet.has(dependency)) {\n return false;\n }\n }\n\n return true;\n}\n\n// List derived from Gecko source code:\n// https://github.com/mozilla/gecko-dev/blob/4e638efc71/layout/style/test/property_database.js\nvar shorthandToLonghand = {\n animation: ['animationDelay', 'animationDirection', 'animationDuration', 'animationFillMode', 'animationIterationCount', 'animationName', 'animationPlayState', 'animationTimingFunction'],\n background: ['backgroundAttachment', 'backgroundClip', 'backgroundColor', 'backgroundImage', 'backgroundOrigin', 'backgroundPositionX', 'backgroundPositionY', 'backgroundRepeat', 'backgroundSize'],\n backgroundPosition: ['backgroundPositionX', 'backgroundPositionY'],\n border: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth', 'borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth', 'borderLeftColor', 'borderLeftStyle', 'borderLeftWidth', 'borderRightColor', 'borderRightStyle', 'borderRightWidth', 'borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderBlockEnd: ['borderBlockEndColor', 'borderBlockEndStyle', 'borderBlockEndWidth'],\n borderBlockStart: ['borderBlockStartColor', 'borderBlockStartStyle', 'borderBlockStartWidth'],\n borderBottom: ['borderBottomColor', 'borderBottomStyle', 'borderBottomWidth'],\n borderColor: ['borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor'],\n borderImage: ['borderImageOutset', 'borderImageRepeat', 'borderImageSlice', 'borderImageSource', 'borderImageWidth'],\n borderInlineEnd: ['borderInlineEndColor', 'borderInlineEndStyle', 'borderInlineEndWidth'],\n borderInlineStart: ['borderInlineStartColor', 'borderInlineStartStyle', 'borderInlineStartWidth'],\n borderLeft: ['borderLeftColor', 'borderLeftStyle', 'borderLeftWidth'],\n borderRadius: ['borderBottomLeftRadius', 'borderBottomRightRadius', 'borderTopLeftRadius', 'borderTopRightRadius'],\n borderRight: ['borderRightColor', 'borderRightStyle', 'borderRightWidth'],\n borderStyle: ['borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle'],\n borderTop: ['borderTopColor', 'borderTopStyle', 'borderTopWidth'],\n borderWidth: ['borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth'],\n columnRule: ['columnRuleColor', 'columnRuleStyle', 'columnRuleWidth'],\n columns: ['columnCount', 'columnWidth'],\n flex: ['flexBasis', 'flexGrow', 'flexShrink'],\n flexFlow: ['flexDirection', 'flexWrap'],\n font: ['fontFamily', 'fontFeatureSettings', 'fontKerning', 'fontLanguageOverride', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition', 'fontWeight', 'lineHeight'],\n fontVariant: ['fontVariantAlternates', 'fontVariantCaps', 'fontVariantEastAsian', 'fontVariantLigatures', 'fontVariantNumeric', 'fontVariantPosition'],\n gap: ['columnGap', 'rowGap'],\n grid: ['gridAutoColumns', 'gridAutoFlow', 'gridAutoRows', 'gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n gridArea: ['gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart'],\n gridColumn: ['gridColumnEnd', 'gridColumnStart'],\n gridColumnGap: ['columnGap'],\n gridGap: ['columnGap', 'rowGap'],\n gridRow: ['gridRowEnd', 'gridRowStart'],\n gridRowGap: ['rowGap'],\n gridTemplate: ['gridTemplateAreas', 'gridTemplateColumns', 'gridTemplateRows'],\n listStyle: ['listStyleImage', 'listStylePosition', 'listStyleType'],\n margin: ['marginBottom', 'marginLeft', 'marginRight', 'marginTop'],\n marker: ['markerEnd', 'markerMid', 'markerStart'],\n mask: ['maskClip', 'maskComposite', 'maskImage', 'maskMode', 'maskOrigin', 'maskPositionX', 'maskPositionY', 'maskRepeat', 'maskSize'],\n maskPosition: ['maskPositionX', 'maskPositionY'],\n outline: ['outlineColor', 'outlineStyle', 'outlineWidth'],\n overflow: ['overflowX', 'overflowY'],\n padding: ['paddingBottom', 'paddingLeft', 'paddingRight', 'paddingTop'],\n placeContent: ['alignContent', 'justifyContent'],\n placeItems: ['alignItems', 'justifyItems'],\n placeSelf: ['alignSelf', 'justifySelf'],\n textDecoration: ['textDecorationColor', 'textDecorationLine', 'textDecorationStyle'],\n textEmphasis: ['textEmphasisColor', 'textEmphasisStyle'],\n transition: ['transitionDelay', 'transitionDuration', 'transitionProperty', 'transitionTimingFunction'],\n wordWrap: ['overflowWrap']\n};\n\n/**\n * CSS properties which accept numbers but are not in units of \"px\".\n */\nvar isUnitlessNumber = {\n animationIterationCount: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n columns: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n flexOrder: true,\n gridArea: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowSpan: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnSpan: true,\n gridColumnStart: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related properties\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true\n};\n/**\n * @param {string} prefix vendor-specific prefix, eg: Webkit\n * @param {string} key style name, eg: transitionDuration\n * @return {string} style name prefixed with `prefix`, properly camelCased, eg:\n * WebkitTransitionDuration\n */\n\nfunction prefixKey(prefix, key) {\n return prefix + key.charAt(0).toUpperCase() + key.substring(1);\n}\n/**\n * Support style names that may come passed in prefixed by adding permutations\n * of vendor prefixes.\n */\n\n\nvar prefixes = ['Webkit', 'ms', 'Moz', 'O']; // Using Object.keys here, or else the vanilla for-in loop makes IE8 go into an\n// infinite loop, because it iterates over the newly added props too.\n\nObject.keys(isUnitlessNumber).forEach(function (prop) {\n prefixes.forEach(function (prefix) {\n isUnitlessNumber[prefixKey(prefix, prop)] = isUnitlessNumber[prop];\n });\n});\n\n/**\n * Convert a value into the proper css writable value. The style name `name`\n * should be logical (no hyphens), as specified\n * in `CSSProperty.isUnitlessNumber`.\n *\n * @param {string} name CSS property name such as `topMargin`.\n * @param {*} value CSS property value such as `10px`.\n * @return {string} Normalized style value with dimensions applied.\n */\n\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n // Note that we've removed escapeTextForBrowser() calls here since the\n // whole string will be escaped when the attribute is injected into\n // the markup. If you provide unsafe user data here they can inject\n // arbitrary CSS which may be problematic (I couldn't repro this):\n // https://www.owasp.org/index.php/XSS_Filter_Evasion_Cheat_Sheet\n // http://www.thespanner.co.uk/2007/11/26/ultimate-xss-css-injection/\n // This is not an XSS hole but instead a potential CSS injection issue\n // which has lead to a greater discussion about how we're going to\n // trust URLs moving forward. See #2115901\n var isEmpty = value == null || typeof value === 'boolean' || value === '';\n\n if (isEmpty) {\n return '';\n }\n\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) {\n return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n }\n\n return ('' + value).trim();\n}\n\nvar uppercasePattern = /([A-Z])/g;\nvar msPattern = /^ms-/;\n/**\n * Hyphenates a camelcased CSS property name, for example:\n *\n * > hyphenateStyleName('backgroundColor')\n * < \"background-color\"\n * > hyphenateStyleName('MozTransition')\n * < \"-moz-transition\"\n * > hyphenateStyleName('msTransition')\n * < \"-ms-transition\"\n *\n * As Modernizr suggests (http://modernizr.com/docs/#prefixed), an `ms` prefix\n * is converted to `-ms-`.\n */\n\nfunction hyphenateStyleName(name) {\n return name.replace(uppercasePattern, '-$1').toLowerCase().replace(msPattern, '-ms-');\n}\n\nvar warnValidStyle = function () {};\n\n{\n // 'msTransform' is correct, but the other prefixes should be capitalized\n var badVendoredStyleNamePattern = /^(?:webkit|moz|o)[A-Z]/;\n var msPattern$1 = /^-ms-/;\n var hyphenPattern = /-(.)/g; // style values shouldn't contain a semicolon\n\n var badStyleValueWithSemicolonPattern = /;\\s*$/;\n var warnedStyleNames = {};\n var warnedStyleValues = {};\n var warnedForNaNValue = false;\n var warnedForInfinityValue = false;\n\n var camelize = function (string) {\n return string.replace(hyphenPattern, function (_, character) {\n return character.toUpperCase();\n });\n };\n\n var warnHyphenatedStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n warning$1(false, 'Unsupported style property %s. Did you mean %s?', name, // As Andi Smith suggests\n // (http://www.andismith.com/blog/2012/02/modernizr-prefixed/), an `-ms` prefix\n // is converted to lowercase `ms`.\n camelize(name.replace(msPattern$1, 'ms-')));\n };\n\n var warnBadVendoredStyleName = function (name) {\n if (warnedStyleNames.hasOwnProperty(name) && warnedStyleNames[name]) {\n return;\n }\n\n warnedStyleNames[name] = true;\n warning$1(false, 'Unsupported vendor-prefixed style property %s. Did you mean %s?', name, name.charAt(0).toUpperCase() + name.slice(1));\n };\n\n var warnStyleValueWithSemicolon = function (name, value) {\n if (warnedStyleValues.hasOwnProperty(value) && warnedStyleValues[value]) {\n return;\n }\n\n warnedStyleValues[value] = true;\n warning$1(false, \"Style property values shouldn't contain a semicolon. \" + 'Try \"%s: %s\" instead.', name, value.replace(badStyleValueWithSemicolonPattern, ''));\n };\n\n var warnStyleValueIsNaN = function (name, value) {\n if (warnedForNaNValue) {\n return;\n }\n\n warnedForNaNValue = true;\n warning$1(false, '`NaN` is an invalid value for the `%s` css style property.', name);\n };\n\n var warnStyleValueIsInfinity = function (name, value) {\n if (warnedForInfinityValue) {\n return;\n }\n\n warnedForInfinityValue = true;\n warning$1(false, '`Infinity` is an invalid value for the `%s` css style property.', name);\n };\n\n warnValidStyle = function (name, value) {\n if (name.indexOf('-') > -1) {\n warnHyphenatedStyleName(name);\n } else if (badVendoredStyleNamePattern.test(name)) {\n warnBadVendoredStyleName(name);\n } else if (badStyleValueWithSemicolonPattern.test(value)) {\n warnStyleValueWithSemicolon(name, value);\n }\n\n if (typeof value === 'number') {\n if (isNaN(value)) {\n warnStyleValueIsNaN(name, value);\n } else if (!isFinite(value)) {\n warnStyleValueIsInfinity(name, value);\n }\n }\n };\n}\n\nvar warnValidStyle$1 = warnValidStyle;\n\n/**\n * Operations for dealing with CSS properties.\n */\n\n/**\n * This creates a string that is expected to be equivalent to the style\n * attribute generated by server-side rendering. It by-passes warnings and\n * security checks so it's not safe to use this value for anything other than\n * comparison. It is only used in DEV for SSR validation.\n */\n\nfunction createDangerousStringForStyles(styles) {\n {\n var serialized = '';\n var delimiter = '';\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var styleValue = styles[styleName];\n\n if (styleValue != null) {\n var isCustomProperty = styleName.indexOf('--') === 0;\n serialized += delimiter + (isCustomProperty ? styleName : hyphenateStyleName(styleName)) + ':';\n serialized += dangerousStyleValue(styleName, styleValue, isCustomProperty);\n delimiter = ';';\n }\n }\n\n return serialized || null;\n }\n}\n/**\n * Sets the value for multiple styles on a node. If a value is specified as\n * '' (empty string), the corresponding style property will be unset.\n *\n * @param {DOMElement} node\n * @param {object} styles\n */\n\nfunction setValueForStyles(node, styles) {\n var style = node.style;\n\n for (var styleName in styles) {\n if (!styles.hasOwnProperty(styleName)) {\n continue;\n }\n\n var isCustomProperty = styleName.indexOf('--') === 0;\n\n {\n if (!isCustomProperty) {\n warnValidStyle$1(styleName, styles[styleName]);\n }\n }\n\n var styleValue = dangerousStyleValue(styleName, styles[styleName], isCustomProperty);\n\n if (styleName === 'float') {\n styleName = 'cssFloat';\n }\n\n if (isCustomProperty) {\n style.setProperty(styleName, styleValue);\n } else {\n style[styleName] = styleValue;\n }\n }\n}\n\nfunction isValueEmpty(value) {\n return value == null || typeof value === 'boolean' || value === '';\n}\n/**\n * Given {color: 'red', overflow: 'hidden'} returns {\n * color: 'color',\n * overflowX: 'overflow',\n * overflowY: 'overflow',\n * }. This can be read as \"the overflowY property was set by the overflow\n * shorthand\". That is, the values are the property that each was derived from.\n */\n\n\nfunction expandShorthandMap(styles) {\n var expanded = {};\n\n for (var key in styles) {\n var longhands = shorthandToLonghand[key] || [key];\n\n for (var i = 0; i < longhands.length; i++) {\n expanded[longhands[i]] = key;\n }\n }\n\n return expanded;\n}\n/**\n * When mixing shorthand and longhand property names, we warn during updates if\n * we expect an incorrect result to occur. In particular, we warn for:\n *\n * Updating a shorthand property (longhand gets overwritten):\n * {font: 'foo', fontVariant: 'bar'} -> {font: 'baz', fontVariant: 'bar'}\n * becomes .style.font = 'baz'\n * Removing a shorthand property (longhand gets lost too):\n * {font: 'foo', fontVariant: 'bar'} -> {fontVariant: 'bar'}\n * becomes .style.font = ''\n * Removing a longhand property (should revert to shorthand; doesn't):\n * {font: 'foo', fontVariant: 'bar'} -> {font: 'foo'}\n * becomes .style.fontVariant = ''\n */\n\n\nfunction validateShorthandPropertyCollisionInDev(styleUpdates, nextStyles) {\n if (!warnAboutShorthandPropertyCollision) {\n return;\n }\n\n if (!nextStyles) {\n return;\n }\n\n var expandedUpdates = expandShorthandMap(styleUpdates);\n var expandedStyles = expandShorthandMap(nextStyles);\n var warnedAbout = {};\n\n for (var key in expandedUpdates) {\n var originalKey = expandedUpdates[key];\n var correctOriginalKey = expandedStyles[key];\n\n if (correctOriginalKey && originalKey !== correctOriginalKey) {\n var warningKey = originalKey + ',' + correctOriginalKey;\n\n if (warnedAbout[warningKey]) {\n continue;\n }\n\n warnedAbout[warningKey] = true;\n warning$1(false, '%s a style property during rerender (%s) when a ' + 'conflicting property is set (%s) can lead to styling bugs. To ' + \"avoid this, don't mix shorthand and non-shorthand properties \" + 'for the same value; instead, replace the shorthand with ' + 'separate values.', isValueEmpty(styleUpdates[originalKey]) ? 'Removing' : 'Updating', originalKey, correctOriginalKey);\n }\n }\n}\n\n// For HTML, certain tags should omit their close tag. We keep a whitelist for\n// those special-case tags.\nvar omittedCloseTags = {\n area: true,\n base: true,\n br: true,\n col: true,\n embed: true,\n hr: true,\n img: true,\n input: true,\n keygen: true,\n link: true,\n meta: true,\n param: true,\n source: true,\n track: true,\n wbr: true // NOTE: menuitem's close tag should be omitted, but that causes problems.\n\n};\n\n// `omittedCloseTags` except that `menuitem` should still have its closing tag.\n\nvar voidElementTags = _assign({\n menuitem: true\n}, omittedCloseTags);\n\n// or add stack by default to invariants where possible.\n\nvar HTML$1 = '__html';\nvar ReactDebugCurrentFrame$3 = null;\n\n{\n ReactDebugCurrentFrame$3 = ReactSharedInternals.ReactDebugCurrentFrame;\n}\n\nfunction assertValidProps(tag, props) {\n if (!props) {\n return;\n } // Note the use of `==` which checks for null or undefined.\n\n\n if (voidElementTags[tag]) {\n (function () {\n if (!(props.children == null && props.dangerouslySetInnerHTML == null)) {\n {\n throw ReactError(Error(tag + \" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.\" + (ReactDebugCurrentFrame$3.getStackAddendum())));\n }\n }\n })();\n }\n\n if (props.dangerouslySetInnerHTML != null) {\n (function () {\n if (!(props.children == null)) {\n {\n throw ReactError(Error(\"Can only set one of `children` or `props.dangerouslySetInnerHTML`.\"));\n }\n }\n })();\n\n (function () {\n if (!(typeof props.dangerouslySetInnerHTML === 'object' && HTML$1 in props.dangerouslySetInnerHTML)) {\n {\n throw ReactError(Error(\"`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://fb.me/react-invariant-dangerously-set-inner-html for more information.\"));\n }\n }\n })();\n }\n\n {\n !(props.suppressContentEditableWarning || !props.contentEditable || props.children == null) ? warning$1(false, 'A component is `contentEditable` and contains `children` managed by ' + 'React. It is now your responsibility to guarantee that none of ' + 'those nodes are unexpectedly modified or duplicated. This is ' + 'probably not intentional.') : void 0;\n }\n\n (function () {\n if (!(props.style == null || typeof props.style === 'object')) {\n {\n throw ReactError(Error(\"The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.\" + (ReactDebugCurrentFrame$3.getStackAddendum())));\n }\n }\n })();\n}\n\nfunction isCustomComponent(tagName, props) {\n if (tagName.indexOf('-') === -1) {\n return typeof props.is === 'string';\n }\n\n switch (tagName) {\n // These are reserved SVG and MathML elements.\n // We don't mind this whitelist too much because we expect it to never grow.\n // The alternative is to track the namespace in a few places which is convoluted.\n // https://w3c.github.io/webcomponents/spec/custom/#custom-elements-core-concepts\n case 'annotation-xml':\n case 'color-profile':\n case 'font-face':\n case 'font-face-src':\n case 'font-face-uri':\n case 'font-face-format':\n case 'font-face-name':\n case 'missing-glyph':\n return false;\n\n default:\n return true;\n }\n}\n\n// When adding attributes to the HTML or SVG whitelist, be sure to\n// also add them to this module to ensure casing and incorrect name\n// warnings.\nvar possibleStandardNames = {\n // HTML\n accept: 'accept',\n acceptcharset: 'acceptCharset',\n 'accept-charset': 'acceptCharset',\n accesskey: 'accessKey',\n action: 'action',\n allowfullscreen: 'allowFullScreen',\n alt: 'alt',\n as: 'as',\n async: 'async',\n autocapitalize: 'autoCapitalize',\n autocomplete: 'autoComplete',\n autocorrect: 'autoCorrect',\n autofocus: 'autoFocus',\n autoplay: 'autoPlay',\n autosave: 'autoSave',\n capture: 'capture',\n cellpadding: 'cellPadding',\n cellspacing: 'cellSpacing',\n challenge: 'challenge',\n charset: 'charSet',\n checked: 'checked',\n children: 'children',\n cite: 'cite',\n class: 'className',\n classid: 'classID',\n classname: 'className',\n cols: 'cols',\n colspan: 'colSpan',\n content: 'content',\n contenteditable: 'contentEditable',\n contextmenu: 'contextMenu',\n controls: 'controls',\n controlslist: 'controlsList',\n coords: 'coords',\n crossorigin: 'crossOrigin',\n dangerouslysetinnerhtml: 'dangerouslySetInnerHTML',\n data: 'data',\n datetime: 'dateTime',\n default: 'default',\n defaultchecked: 'defaultChecked',\n defaultvalue: 'defaultValue',\n defer: 'defer',\n dir: 'dir',\n disabled: 'disabled',\n disablepictureinpicture: 'disablePictureInPicture',\n download: 'download',\n draggable: 'draggable',\n enctype: 'encType',\n for: 'htmlFor',\n form: 'form',\n formmethod: 'formMethod',\n formaction: 'formAction',\n formenctype: 'formEncType',\n formnovalidate: 'formNoValidate',\n formtarget: 'formTarget',\n frameborder: 'frameBorder',\n headers: 'headers',\n height: 'height',\n hidden: 'hidden',\n high: 'high',\n href: 'href',\n hreflang: 'hrefLang',\n htmlfor: 'htmlFor',\n httpequiv: 'httpEquiv',\n 'http-equiv': 'httpEquiv',\n icon: 'icon',\n id: 'id',\n innerhtml: 'innerHTML',\n inputmode: 'inputMode',\n integrity: 'integrity',\n is: 'is',\n itemid: 'itemID',\n itemprop: 'itemProp',\n itemref: 'itemRef',\n itemscope: 'itemScope',\n itemtype: 'itemType',\n keyparams: 'keyParams',\n keytype: 'keyType',\n kind: 'kind',\n label: 'label',\n lang: 'lang',\n list: 'list',\n loop: 'loop',\n low: 'low',\n manifest: 'manifest',\n marginwidth: 'marginWidth',\n marginheight: 'marginHeight',\n max: 'max',\n maxlength: 'maxLength',\n media: 'media',\n mediagroup: 'mediaGroup',\n method: 'method',\n min: 'min',\n minlength: 'minLength',\n multiple: 'multiple',\n muted: 'muted',\n name: 'name',\n nomodule: 'noModule',\n nonce: 'nonce',\n novalidate: 'noValidate',\n open: 'open',\n optimum: 'optimum',\n pattern: 'pattern',\n placeholder: 'placeholder',\n playsinline: 'playsInline',\n poster: 'poster',\n preload: 'preload',\n profile: 'profile',\n radiogroup: 'radioGroup',\n readonly: 'readOnly',\n referrerpolicy: 'referrerPolicy',\n rel: 'rel',\n required: 'required',\n reversed: 'reversed',\n role: 'role',\n rows: 'rows',\n rowspan: 'rowSpan',\n sandbox: 'sandbox',\n scope: 'scope',\n scoped: 'scoped',\n scrolling: 'scrolling',\n seamless: 'seamless',\n selected: 'selected',\n shape: 'shape',\n size: 'size',\n sizes: 'sizes',\n span: 'span',\n spellcheck: 'spellCheck',\n src: 'src',\n srcdoc: 'srcDoc',\n srclang: 'srcLang',\n srcset: 'srcSet',\n start: 'start',\n step: 'step',\n style: 'style',\n summary: 'summary',\n tabindex: 'tabIndex',\n target: 'target',\n title: 'title',\n type: 'type',\n usemap: 'useMap',\n value: 'value',\n width: 'width',\n wmode: 'wmode',\n wrap: 'wrap',\n // SVG\n about: 'about',\n accentheight: 'accentHeight',\n 'accent-height': 'accentHeight',\n accumulate: 'accumulate',\n additive: 'additive',\n alignmentbaseline: 'alignmentBaseline',\n 'alignment-baseline': 'alignmentBaseline',\n allowreorder: 'allowReorder',\n alphabetic: 'alphabetic',\n amplitude: 'amplitude',\n arabicform: 'arabicForm',\n 'arabic-form': 'arabicForm',\n ascent: 'ascent',\n attributename: 'attributeName',\n attributetype: 'attributeType',\n autoreverse: 'autoReverse',\n azimuth: 'azimuth',\n basefrequency: 'baseFrequency',\n baselineshift: 'baselineShift',\n 'baseline-shift': 'baselineShift',\n baseprofile: 'baseProfile',\n bbox: 'bbox',\n begin: 'begin',\n bias: 'bias',\n by: 'by',\n calcmode: 'calcMode',\n capheight: 'capHeight',\n 'cap-height': 'capHeight',\n clip: 'clip',\n clippath: 'clipPath',\n 'clip-path': 'clipPath',\n clippathunits: 'clipPathUnits',\n cliprule: 'clipRule',\n 'clip-rule': 'clipRule',\n color: 'color',\n colorinterpolation: 'colorInterpolation',\n 'color-interpolation': 'colorInterpolation',\n colorinterpolationfilters: 'colorInterpolationFilters',\n 'color-interpolation-filters': 'colorInterpolationFilters',\n colorprofile: 'colorProfile',\n 'color-profile': 'colorProfile',\n colorrendering: 'colorRendering',\n 'color-rendering': 'colorRendering',\n contentscripttype: 'contentScriptType',\n contentstyletype: 'contentStyleType',\n cursor: 'cursor',\n cx: 'cx',\n cy: 'cy',\n d: 'd',\n datatype: 'datatype',\n decelerate: 'decelerate',\n descent: 'descent',\n diffuseconstant: 'diffuseConstant',\n direction: 'direction',\n display: 'display',\n divisor: 'divisor',\n dominantbaseline: 'dominantBaseline',\n 'dominant-baseline': 'dominantBaseline',\n dur: 'dur',\n dx: 'dx',\n dy: 'dy',\n edgemode: 'edgeMode',\n elevation: 'elevation',\n enablebackground: 'enableBackground',\n 'enable-background': 'enableBackground',\n end: 'end',\n exponent: 'exponent',\n externalresourcesrequired: 'externalResourcesRequired',\n fill: 'fill',\n fillopacity: 'fillOpacity',\n 'fill-opacity': 'fillOpacity',\n fillrule: 'fillRule',\n 'fill-rule': 'fillRule',\n filter: 'filter',\n filterres: 'filterRes',\n filterunits: 'filterUnits',\n floodopacity: 'floodOpacity',\n 'flood-opacity': 'floodOpacity',\n floodcolor: 'floodColor',\n 'flood-color': 'floodColor',\n focusable: 'focusable',\n fontfamily: 'fontFamily',\n 'font-family': 'fontFamily',\n fontsize: 'fontSize',\n 'font-size': 'fontSize',\n fontsizeadjust: 'fontSizeAdjust',\n 'font-size-adjust': 'fontSizeAdjust',\n fontstretch: 'fontStretch',\n 'font-stretch': 'fontStretch',\n fontstyle: 'fontStyle',\n 'font-style': 'fontStyle',\n fontvariant: 'fontVariant',\n 'font-variant': 'fontVariant',\n fontweight: 'fontWeight',\n 'font-weight': 'fontWeight',\n format: 'format',\n from: 'from',\n fx: 'fx',\n fy: 'fy',\n g1: 'g1',\n g2: 'g2',\n glyphname: 'glyphName',\n 'glyph-name': 'glyphName',\n glyphorientationhorizontal: 'glyphOrientationHorizontal',\n 'glyph-orientation-horizontal': 'glyphOrientationHorizontal',\n glyphorientationvertical: 'glyphOrientationVertical',\n 'glyph-orientation-vertical': 'glyphOrientationVertical',\n glyphref: 'glyphRef',\n gradienttransform: 'gradientTransform',\n gradientunits: 'gradientUnits',\n hanging: 'hanging',\n horizadvx: 'horizAdvX',\n 'horiz-adv-x': 'horizAdvX',\n horizoriginx: 'horizOriginX',\n 'horiz-origin-x': 'horizOriginX',\n ideographic: 'ideographic',\n imagerendering: 'imageRendering',\n 'image-rendering': 'imageRendering',\n in2: 'in2',\n in: 'in',\n inlist: 'inlist',\n intercept: 'intercept',\n k1: 'k1',\n k2: 'k2',\n k3: 'k3',\n k4: 'k4',\n k: 'k',\n kernelmatrix: 'kernelMatrix',\n kernelunitlength: 'kernelUnitLength',\n kerning: 'kerning',\n keypoints: 'keyPoints',\n keysplines: 'keySplines',\n keytimes: 'keyTimes',\n lengthadjust: 'lengthAdjust',\n letterspacing: 'letterSpacing',\n 'letter-spacing': 'letterSpacing',\n lightingcolor: 'lightingColor',\n 'lighting-color': 'lightingColor',\n limitingconeangle: 'limitingConeAngle',\n local: 'local',\n markerend: 'markerEnd',\n 'marker-end': 'markerEnd',\n markerheight: 'markerHeight',\n markermid: 'markerMid',\n 'marker-mid': 'markerMid',\n markerstart: 'markerStart',\n 'marker-start': 'markerStart',\n markerunits: 'markerUnits',\n markerwidth: 'markerWidth',\n mask: 'mask',\n maskcontentunits: 'maskContentUnits',\n maskunits: 'maskUnits',\n mathematical: 'mathematical',\n mode: 'mode',\n numoctaves: 'numOctaves',\n offset: 'offset',\n opacity: 'opacity',\n operator: 'operator',\n order: 'order',\n orient: 'orient',\n orientation: 'orientation',\n origin: 'origin',\n overflow: 'overflow',\n overlineposition: 'overlinePosition',\n 'overline-position': 'overlinePosition',\n overlinethickness: 'overlineThickness',\n 'overline-thickness': 'overlineThickness',\n paintorder: 'paintOrder',\n 'paint-order': 'paintOrder',\n panose1: 'panose1',\n 'panose-1': 'panose1',\n pathlength: 'pathLength',\n patterncontentunits: 'patternContentUnits',\n patterntransform: 'patternTransform',\n patternunits: 'patternUnits',\n pointerevents: 'pointerEvents',\n 'pointer-events': 'pointerEvents',\n points: 'points',\n pointsatx: 'pointsAtX',\n pointsaty: 'pointsAtY',\n pointsatz: 'pointsAtZ',\n prefix: 'prefix',\n preservealpha: 'preserveAlpha',\n preserveaspectratio: 'preserveAspectRatio',\n primitiveunits: 'primitiveUnits',\n property: 'property',\n r: 'r',\n radius: 'radius',\n refx: 'refX',\n refy: 'refY',\n renderingintent: 'renderingIntent',\n 'rendering-intent': 'renderingIntent',\n repeatcount: 'repeatCount',\n repeatdur: 'repeatDur',\n requiredextensions: 'requiredExtensions',\n requiredfeatures: 'requiredFeatures',\n resource: 'resource',\n restart: 'restart',\n result: 'result',\n results: 'results',\n rotate: 'rotate',\n rx: 'rx',\n ry: 'ry',\n scale: 'scale',\n security: 'security',\n seed: 'seed',\n shaperendering: 'shapeRendering',\n 'shape-rendering': 'shapeRendering',\n slope: 'slope',\n spacing: 'spacing',\n specularconstant: 'specularConstant',\n specularexponent: 'specularExponent',\n speed: 'speed',\n spreadmethod: 'spreadMethod',\n startoffset: 'startOffset',\n stddeviation: 'stdDeviation',\n stemh: 'stemh',\n stemv: 'stemv',\n stitchtiles: 'stitchTiles',\n stopcolor: 'stopColor',\n 'stop-color': 'stopColor',\n stopopacity: 'stopOpacity',\n 'stop-opacity': 'stopOpacity',\n strikethroughposition: 'strikethroughPosition',\n 'strikethrough-position': 'strikethroughPosition',\n strikethroughthickness: 'strikethroughThickness',\n 'strikethrough-thickness': 'strikethroughThickness',\n string: 'string',\n stroke: 'stroke',\n strokedasharray: 'strokeDasharray',\n 'stroke-dasharray': 'strokeDasharray',\n strokedashoffset: 'strokeDashoffset',\n 'stroke-dashoffset': 'strokeDashoffset',\n strokelinecap: 'strokeLinecap',\n 'stroke-linecap': 'strokeLinecap',\n strokelinejoin: 'strokeLinejoin',\n 'stroke-linejoin': 'strokeLinejoin',\n strokemiterlimit: 'strokeMiterlimit',\n 'stroke-miterlimit': 'strokeMiterlimit',\n strokewidth: 'strokeWidth',\n 'stroke-width': 'strokeWidth',\n strokeopacity: 'strokeOpacity',\n 'stroke-opacity': 'strokeOpacity',\n suppresscontenteditablewarning: 'suppressContentEditableWarning',\n suppresshydrationwarning: 'suppressHydrationWarning',\n surfacescale: 'surfaceScale',\n systemlanguage: 'systemLanguage',\n tablevalues: 'tableValues',\n targetx: 'targetX',\n targety: 'targetY',\n textanchor: 'textAnchor',\n 'text-anchor': 'textAnchor',\n textdecoration: 'textDecoration',\n 'text-decoration': 'textDecoration',\n textlength: 'textLength',\n textrendering: 'textRendering',\n 'text-rendering': 'textRendering',\n to: 'to',\n transform: 'transform',\n typeof: 'typeof',\n u1: 'u1',\n u2: 'u2',\n underlineposition: 'underlinePosition',\n 'underline-position': 'underlinePosition',\n underlinethickness: 'underlineThickness',\n 'underline-thickness': 'underlineThickness',\n unicode: 'unicode',\n unicodebidi: 'unicodeBidi',\n 'unicode-bidi': 'unicodeBidi',\n unicoderange: 'unicodeRange',\n 'unicode-range': 'unicodeRange',\n unitsperem: 'unitsPerEm',\n 'units-per-em': 'unitsPerEm',\n unselectable: 'unselectable',\n valphabetic: 'vAlphabetic',\n 'v-alphabetic': 'vAlphabetic',\n values: 'values',\n vectoreffect: 'vectorEffect',\n 'vector-effect': 'vectorEffect',\n version: 'version',\n vertadvy: 'vertAdvY',\n 'vert-adv-y': 'vertAdvY',\n vertoriginx: 'vertOriginX',\n 'vert-origin-x': 'vertOriginX',\n vertoriginy: 'vertOriginY',\n 'vert-origin-y': 'vertOriginY',\n vhanging: 'vHanging',\n 'v-hanging': 'vHanging',\n videographic: 'vIdeographic',\n 'v-ideographic': 'vIdeographic',\n viewbox: 'viewBox',\n viewtarget: 'viewTarget',\n visibility: 'visibility',\n vmathematical: 'vMathematical',\n 'v-mathematical': 'vMathematical',\n vocab: 'vocab',\n widths: 'widths',\n wordspacing: 'wordSpacing',\n 'word-spacing': 'wordSpacing',\n writingmode: 'writingMode',\n 'writing-mode': 'writingMode',\n x1: 'x1',\n x2: 'x2',\n x: 'x',\n xchannelselector: 'xChannelSelector',\n xheight: 'xHeight',\n 'x-height': 'xHeight',\n xlinkactuate: 'xlinkActuate',\n 'xlink:actuate': 'xlinkActuate',\n xlinkarcrole: 'xlinkArcrole',\n 'xlink:arcrole': 'xlinkArcrole',\n xlinkhref: 'xlinkHref',\n 'xlink:href': 'xlinkHref',\n xlinkrole: 'xlinkRole',\n 'xlink:role': 'xlinkRole',\n xlinkshow: 'xlinkShow',\n 'xlink:show': 'xlinkShow',\n xlinktitle: 'xlinkTitle',\n 'xlink:title': 'xlinkTitle',\n xlinktype: 'xlinkType',\n 'xlink:type': 'xlinkType',\n xmlbase: 'xmlBase',\n 'xml:base': 'xmlBase',\n xmllang: 'xmlLang',\n 'xml:lang': 'xmlLang',\n xmlns: 'xmlns',\n 'xml:space': 'xmlSpace',\n xmlnsxlink: 'xmlnsXlink',\n 'xmlns:xlink': 'xmlnsXlink',\n xmlspace: 'xmlSpace',\n y1: 'y1',\n y2: 'y2',\n y: 'y',\n ychannelselector: 'yChannelSelector',\n z: 'z',\n zoomandpan: 'zoomAndPan'\n};\n\nvar ariaProperties = {\n 'aria-current': 0,\n // state\n 'aria-details': 0,\n 'aria-disabled': 0,\n // state\n 'aria-hidden': 0,\n // state\n 'aria-invalid': 0,\n // state\n 'aria-keyshortcuts': 0,\n 'aria-label': 0,\n 'aria-roledescription': 0,\n // Widget Attributes\n 'aria-autocomplete': 0,\n 'aria-checked': 0,\n 'aria-expanded': 0,\n 'aria-haspopup': 0,\n 'aria-level': 0,\n 'aria-modal': 0,\n 'aria-multiline': 0,\n 'aria-multiselectable': 0,\n 'aria-orientation': 0,\n 'aria-placeholder': 0,\n 'aria-pressed': 0,\n 'aria-readonly': 0,\n 'aria-required': 0,\n 'aria-selected': 0,\n 'aria-sort': 0,\n 'aria-valuemax': 0,\n 'aria-valuemin': 0,\n 'aria-valuenow': 0,\n 'aria-valuetext': 0,\n // Live Region Attributes\n 'aria-atomic': 0,\n 'aria-busy': 0,\n 'aria-live': 0,\n 'aria-relevant': 0,\n // Drag-and-Drop Attributes\n 'aria-dropeffect': 0,\n 'aria-grabbed': 0,\n // Relationship Attributes\n 'aria-activedescendant': 0,\n 'aria-colcount': 0,\n 'aria-colindex': 0,\n 'aria-colspan': 0,\n 'aria-controls': 0,\n 'aria-describedby': 0,\n 'aria-errormessage': 0,\n 'aria-flowto': 0,\n 'aria-labelledby': 0,\n 'aria-owns': 0,\n 'aria-posinset': 0,\n 'aria-rowcount': 0,\n 'aria-rowindex': 0,\n 'aria-rowspan': 0,\n 'aria-setsize': 0\n};\n\nvar warnedProperties = {};\nvar rARIA = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar rARIACamel = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty$1 = Object.prototype.hasOwnProperty;\n\nfunction validateProperty(tagName, name) {\n if (hasOwnProperty$1.call(warnedProperties, name) && warnedProperties[name]) {\n return true;\n }\n\n if (rARIACamel.test(name)) {\n var ariaName = 'aria-' + name.slice(4).toLowerCase();\n var correctName = ariaProperties.hasOwnProperty(ariaName) ? ariaName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (correctName == null) {\n warning$1(false, 'Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.', name);\n warnedProperties[name] = true;\n return true;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== correctName) {\n warning$1(false, 'Invalid ARIA attribute `%s`. Did you mean `%s`?', name, correctName);\n warnedProperties[name] = true;\n return true;\n }\n }\n\n if (rARIA.test(name)) {\n var lowerCasedName = name.toLowerCase();\n var standardName = ariaProperties.hasOwnProperty(lowerCasedName) ? lowerCasedName : null; // If this is an aria-* attribute, but is not listed in the known DOM\n // DOM properties, then it is an invalid aria-* attribute.\n\n if (standardName == null) {\n warnedProperties[name] = true;\n return false;\n } // aria-* attributes should be lowercase; suggest the lowercase version.\n\n\n if (name !== standardName) {\n warning$1(false, 'Unknown ARIA attribute `%s`. Did you mean `%s`?', name, standardName);\n warnedProperties[name] = true;\n return true;\n }\n }\n\n return true;\n}\n\nfunction warnInvalidARIAProps(type, props) {\n var invalidProps = [];\n\n for (var key in props) {\n var isValid = validateProperty(type, key);\n\n if (!isValid) {\n invalidProps.push(key);\n }\n }\n\n var unknownPropString = invalidProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (invalidProps.length === 1) {\n warning$1(false, 'Invalid aria prop %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);\n } else if (invalidProps.length > 1) {\n warning$1(false, 'Invalid aria props %s on <%s> tag. ' + 'For details, see https://fb.me/invalid-aria-prop', unknownPropString, type);\n }\n}\n\nfunction validateProperties(type, props) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnInvalidARIAProps(type, props);\n}\n\nvar didWarnValueNull = false;\nfunction validateProperties$1(type, props) {\n if (type !== 'input' && type !== 'textarea' && type !== 'select') {\n return;\n }\n\n if (props != null && props.value === null && !didWarnValueNull) {\n didWarnValueNull = true;\n\n if (type === 'select' && props.multiple) {\n warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty array when `multiple` is set to `true` ' + 'to clear the component or `undefined` for uncontrolled components.', type);\n } else {\n warning$1(false, '`value` prop on `%s` should not be null. ' + 'Consider using an empty string to clear the component or `undefined` ' + 'for uncontrolled components.', type);\n }\n }\n}\n\nvar validateProperty$1 = function () {};\n\n{\n var warnedProperties$1 = {};\n var _hasOwnProperty = Object.prototype.hasOwnProperty;\n var EVENT_NAME_REGEX = /^on./;\n var INVALID_EVENT_NAME_REGEX = /^on[^A-Z]/;\n var rARIA$1 = new RegExp('^(aria)-[' + ATTRIBUTE_NAME_CHAR + ']*$');\n var rARIACamel$1 = new RegExp('^(aria)[A-Z][' + ATTRIBUTE_NAME_CHAR + ']*$');\n\n validateProperty$1 = function (tagName, name, value, canUseEventSystem) {\n if (_hasOwnProperty.call(warnedProperties$1, name) && warnedProperties$1[name]) {\n return true;\n }\n\n var lowerCasedName = name.toLowerCase();\n\n if (lowerCasedName === 'onfocusin' || lowerCasedName === 'onfocusout') {\n warning$1(false, 'React uses onFocus and onBlur instead of onFocusIn and onFocusOut. ' + 'All React events are normalized to bubble, so onFocusIn and onFocusOut ' + 'are not needed/supported by React.');\n warnedProperties$1[name] = true;\n return true;\n } // We can't rely on the event system being injected on the server.\n\n\n if (canUseEventSystem) {\n if (registrationNameModules.hasOwnProperty(name)) {\n return true;\n }\n\n var registrationName = possibleRegistrationNames.hasOwnProperty(lowerCasedName) ? possibleRegistrationNames[lowerCasedName] : null;\n\n if (registrationName != null) {\n warning$1(false, 'Invalid event handler property `%s`. Did you mean `%s`?', name, registrationName);\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (EVENT_NAME_REGEX.test(name)) {\n warning$1(false, 'Unknown event handler property `%s`. It will be ignored.', name);\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (EVENT_NAME_REGEX.test(name)) {\n // If no event plugins have been injected, we are in a server environment.\n // So we can't tell if the event name is correct for sure, but we can filter\n // out known bad ones like `onclick`. We can't suggest a specific replacement though.\n if (INVALID_EVENT_NAME_REGEX.test(name)) {\n warning$1(false, 'Invalid event handler property `%s`. ' + 'React events use the camelCase naming convention, for example `onClick`.', name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } // Let the ARIA attribute hook validate ARIA attributes\n\n\n if (rARIA$1.test(name) || rARIACamel$1.test(name)) {\n return true;\n }\n\n if (lowerCasedName === 'innerhtml') {\n warning$1(false, 'Directly setting property `innerHTML` is not permitted. ' + 'For more information, lookup documentation on `dangerouslySetInnerHTML`.');\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'aria') {\n warning$1(false, 'The `aria` attribute is reserved for future use in React. ' + 'Pass individual `aria-` attributes instead.');\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (lowerCasedName === 'is' && value !== null && value !== undefined && typeof value !== 'string') {\n warning$1(false, 'Received a `%s` for a string attribute `is`. If this is expected, cast ' + 'the value to a string.', typeof value);\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'number' && isNaN(value)) {\n warning$1(false, 'Received NaN for the `%s` attribute. If this is expected, cast ' + 'the value to a string.', name);\n warnedProperties$1[name] = true;\n return true;\n }\n\n var propertyInfo = getPropertyInfo(name);\n var isReserved = propertyInfo !== null && propertyInfo.type === RESERVED; // Known attributes should match the casing specified in the property config.\n\n if (possibleStandardNames.hasOwnProperty(lowerCasedName)) {\n var standardName = possibleStandardNames[lowerCasedName];\n\n if (standardName !== name) {\n warning$1(false, 'Invalid DOM property `%s`. Did you mean `%s`?', name, standardName);\n warnedProperties$1[name] = true;\n return true;\n }\n } else if (!isReserved && name !== lowerCasedName) {\n // Unknown attributes should have lowercase casing since that's how they\n // will be cased anyway with server rendering.\n warning$1(false, 'React does not recognize the `%s` prop on a DOM element. If you ' + 'intentionally want it to appear in the DOM as a custom ' + 'attribute, spell it as lowercase `%s` instead. ' + 'If you accidentally passed it from a parent component, remove ' + 'it from the DOM element.', name, lowerCasedName);\n warnedProperties$1[name] = true;\n return true;\n }\n\n if (typeof value === 'boolean' && shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n if (value) {\n warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.', value, name, name, value, name);\n } else {\n warning$1(false, 'Received `%s` for a non-boolean attribute `%s`.\\n\\n' + 'If you want to write it to the DOM, pass a string instead: ' + '%s=\"%s\" or %s={value.toString()}.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', value, name, name, value, name, name, name);\n }\n\n warnedProperties$1[name] = true;\n return true;\n } // Now that we've validated casing, do not validate\n // data types for reserved props\n\n\n if (isReserved) {\n return true;\n } // Warn when a known attribute is a bad type\n\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, false)) {\n warnedProperties$1[name] = true;\n return false;\n } // Warn when passing the strings 'false' or 'true' into a boolean prop\n\n\n if ((value === 'false' || value === 'true') && propertyInfo !== null && propertyInfo.type === BOOLEAN) {\n warning$1(false, 'Received the string `%s` for the boolean attribute `%s`. ' + '%s ' + 'Did you mean %s={%s}?', value, name, value === 'false' ? 'The browser will interpret it as a truthy value.' : 'Although this works, it will not work as expected if you pass the string \"false\".', name, value);\n warnedProperties$1[name] = true;\n return true;\n }\n\n return true;\n };\n}\n\nvar warnUnknownProperties = function (type, props, canUseEventSystem) {\n var unknownProps = [];\n\n for (var key in props) {\n var isValid = validateProperty$1(type, key, props[key], canUseEventSystem);\n\n if (!isValid) {\n unknownProps.push(key);\n }\n }\n\n var unknownPropString = unknownProps.map(function (prop) {\n return '`' + prop + '`';\n }).join(', ');\n\n if (unknownProps.length === 1) {\n warning$1(false, 'Invalid value for prop %s on <%s> tag. Either remove it from the element, ' + 'or pass a string or number value to keep it in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);\n } else if (unknownProps.length > 1) {\n warning$1(false, 'Invalid values for props %s on <%s> tag. Either remove them from the element, ' + 'or pass a string or number value to keep them in the DOM. ' + 'For details, see https://fb.me/react-attribute-behavior', unknownPropString, type);\n }\n};\n\nfunction validateProperties$2(type, props, canUseEventSystem) {\n if (isCustomComponent(type, props)) {\n return;\n }\n\n warnUnknownProperties(type, props, canUseEventSystem);\n}\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar didWarnInvalidHydration = false;\nvar didWarnShadyDOM = false;\nvar didWarnScriptTags = false;\nvar DANGEROUSLY_SET_INNER_HTML = 'dangerouslySetInnerHTML';\nvar SUPPRESS_CONTENT_EDITABLE_WARNING = 'suppressContentEditableWarning';\nvar SUPPRESS_HYDRATION_WARNING$1 = 'suppressHydrationWarning';\nvar AUTOFOCUS = 'autoFocus';\nvar CHILDREN = 'children';\nvar STYLE$1 = 'style';\nvar HTML = '__html';\nvar LISTENERS = 'listeners';\nvar HTML_NAMESPACE = Namespaces.html;\nvar warnedUnknownTags;\nvar suppressHydrationWarning;\nvar validatePropertiesInDevelopment;\nvar warnForTextDifference;\nvar warnForPropDifference;\nvar warnForExtraAttributes;\nvar warnForInvalidEventListener;\nvar canDiffStyleForHydrationWarning;\nvar normalizeMarkupForTextOrAttribute;\nvar normalizeHTML;\n\n{\n warnedUnknownTags = {\n // Chrome is the only major browser not shipping . But as of July\n // 2017 it intends to ship it due to widespread usage. We intentionally\n // *don't* warn for even if it's unrecognized by Chrome because\n // it soon will be, and many apps have been using it anyway.\n time: true,\n // There are working polyfills for . Let people use it.\n dialog: true,\n // Electron ships a custom tag to display external web content in\n // an isolated frame and process.\n // This tag is not present in non Electron environments such as JSDom which\n // is often used for testing purposes.\n // @see https://electronjs.org/docs/api/webview-tag\n webview: true\n };\n\n validatePropertiesInDevelopment = function (type, props) {\n validateProperties(type, props);\n validateProperties$1(type, props);\n validateProperties$2(type, props,\n /* canUseEventSystem */\n true);\n }; // IE 11 parses & normalizes the style attribute as opposed to other\n // browsers. It adds spaces and sorts the properties in some\n // non-alphabetical order. Handling that would require sorting CSS\n // properties in the client & server versions or applying\n // `expectedStyle` to a temporary DOM node to read its `style` attribute\n // normalized. Since it only affects IE, we're skipping style warnings\n // in that browser completely in favor of doing all that work.\n // See https://github.com/facebook/react/issues/11807\n\n\n canDiffStyleForHydrationWarning = canUseDOM && !document.documentMode; // HTML parsing normalizes CR and CRLF to LF.\n // It also can turn \\u0000 into \\uFFFD inside attributes.\n // https://www.w3.org/TR/html5/single-page.html#preprocessing-the-input-stream\n // If we have a mismatch, it might be caused by that.\n // We will still patch up in this case but not fire the warning.\n\n var NORMALIZE_NEWLINES_REGEX = /\\r\\n?/g;\n var NORMALIZE_NULL_AND_REPLACEMENT_REGEX = /\\u0000|\\uFFFD/g;\n\n normalizeMarkupForTextOrAttribute = function (markup) {\n var markupString = typeof markup === 'string' ? markup : '' + markup;\n return markupString.replace(NORMALIZE_NEWLINES_REGEX, '\\n').replace(NORMALIZE_NULL_AND_REPLACEMENT_REGEX, '');\n };\n\n warnForTextDifference = function (serverText, clientText) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n var normalizedClientText = normalizeMarkupForTextOrAttribute(clientText);\n var normalizedServerText = normalizeMarkupForTextOrAttribute(serverText);\n\n if (normalizedServerText === normalizedClientText) {\n return;\n }\n\n didWarnInvalidHydration = true;\n warningWithoutStack$1(false, 'Text content did not match. Server: \"%s\" Client: \"%s\"', normalizedServerText, normalizedClientText);\n };\n\n warnForPropDifference = function (propName, serverValue, clientValue) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n var normalizedClientValue = normalizeMarkupForTextOrAttribute(clientValue);\n var normalizedServerValue = normalizeMarkupForTextOrAttribute(serverValue);\n\n if (normalizedServerValue === normalizedClientValue) {\n return;\n }\n\n didWarnInvalidHydration = true;\n warningWithoutStack$1(false, 'Prop `%s` did not match. Server: %s Client: %s', propName, JSON.stringify(normalizedServerValue), JSON.stringify(normalizedClientValue));\n };\n\n warnForExtraAttributes = function (attributeNames) {\n if (didWarnInvalidHydration) {\n return;\n }\n\n didWarnInvalidHydration = true;\n var names = [];\n attributeNames.forEach(function (name) {\n names.push(name);\n });\n warningWithoutStack$1(false, 'Extra attributes from the server: %s', names);\n };\n\n warnForInvalidEventListener = function (registrationName, listener) {\n if (listener === false) {\n warning$1(false, 'Expected `%s` listener to be a function, instead got `false`.\\n\\n' + 'If you used to conditionally omit it with %s={condition && value}, ' + 'pass %s={condition ? value : undefined} instead.', registrationName, registrationName, registrationName);\n } else {\n warning$1(false, 'Expected `%s` listener to be a function, instead got a value of `%s` type.', registrationName, typeof listener);\n }\n }; // Parse the HTML and read it back to normalize the HTML string so that it\n // can be used for comparison.\n\n\n normalizeHTML = function (parent, html) {\n // We could have created a separate document here to avoid\n // re-initializing custom elements if they exist. But this breaks\n // how is being handled. So we use the same document.\n // See the discussion in https://github.com/facebook/react/pull/11157.\n var testElement = parent.namespaceURI === HTML_NAMESPACE ? parent.ownerDocument.createElement(parent.tagName) : parent.ownerDocument.createElementNS(parent.namespaceURI, parent.tagName);\n testElement.innerHTML = html;\n return testElement.innerHTML;\n };\n}\n\nfunction ensureListeningTo(rootContainerElement, registrationName) {\n var isDocumentOrFragment = rootContainerElement.nodeType === DOCUMENT_NODE || rootContainerElement.nodeType === DOCUMENT_FRAGMENT_NODE;\n var doc = isDocumentOrFragment ? rootContainerElement : rootContainerElement.ownerDocument;\n listenTo(registrationName, doc);\n}\n\nfunction getOwnerDocumentFromRootContainer(rootContainerElement) {\n return rootContainerElement.nodeType === DOCUMENT_NODE ? rootContainerElement : rootContainerElement.ownerDocument;\n}\n\nfunction noop() {}\n\nfunction trapClickOnNonInteractiveElement(node) {\n // Mobile Safari does not fire properly bubble click events on\n // non-interactive elements, which means delegated click listeners do not\n // fire. The workaround for this bug involves attaching an empty click\n // listener on the target node.\n // http://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n // Just set it using the onclick property so that we don't have to manage any\n // bookkeeping for it. Not sure if we need to clear it when the listener is\n // removed.\n // TODO: Only do this for the relevant Safaris maybe?\n node.onclick = noop;\n}\n\nfunction setInitialDOMProperties(tag, domElement, rootContainerElement, nextProps, isCustomComponentTag) {\n for (var propKey in nextProps) {\n if (!nextProps.hasOwnProperty(propKey)) {\n continue;\n }\n\n var nextProp = nextProps[propKey];\n\n if (propKey === STYLE$1) {\n {\n if (nextProp) {\n // Freeze the next style object so that we can assume it won't be\n // mutated. We have already warned for this in the past.\n Object.freeze(nextProp);\n }\n } // Relies on `updateStylesByID` not mutating `styleUpdates`.\n\n\n setValueForStyles(domElement, nextProp);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n var nextHtml = nextProp ? nextProp[HTML] : undefined;\n\n if (nextHtml != null) {\n setInnerHTML(domElement, nextHtml);\n }\n } else if (propKey === CHILDREN) {\n if (typeof nextProp === 'string') {\n // Avoid setting initial textContent when the text is empty. In IE11 setting\n // textContent on a will cause the placeholder to not\n // show within the until it has been focused and blurred again.\n // https://github.com/facebook/react/issues/6731#issuecomment-254874553\n var canSetTextContent = tag !== 'textarea' || nextProp !== '';\n\n if (canSetTextContent) {\n setTextContent(domElement, nextProp);\n }\n } else if (typeof nextProp === 'number') {\n setTextContent(domElement, '' + nextProp);\n }\n } else if (enableFlareAPI && propKey === LISTENERS || propKey === SUPPRESS_CONTENT_EDITABLE_WARNING || propKey === SUPPRESS_HYDRATION_WARNING$1) {// Noop\n } else if (propKey === AUTOFOCUS) {// We polyfill it separately on the client during commit.\n // We could have excluded it in the property list instead of\n // adding a special case here, but then it wouldn't be emitted\n // on server rendering (but we *do* want to emit it in SSR).\n } else if (registrationNameModules.hasOwnProperty(propKey)) {\n if (nextProp != null) {\n if ( true && typeof nextProp !== 'function') {\n warnForInvalidEventListener(propKey, nextProp);\n }\n\n ensureListeningTo(rootContainerElement, propKey);\n }\n } else if (nextProp != null) {\n setValueForProperty(domElement, propKey, nextProp, isCustomComponentTag);\n }\n }\n}\n\nfunction updateDOMProperties(domElement, updatePayload, wasCustomComponentTag, isCustomComponentTag) {\n // TODO: Handle wasCustomComponentTag\n for (var i = 0; i < updatePayload.length; i += 2) {\n var propKey = updatePayload[i];\n var propValue = updatePayload[i + 1];\n\n if (propKey === STYLE$1) {\n setValueForStyles(domElement, propValue);\n } else if (propKey === DANGEROUSLY_SET_INNER_HTML) {\n setInnerHTML(domElement, propValue);\n } else if (propKey === CHILDREN) {\n setTextContent(domElement, propValue);\n } else {\n setValueForProperty(domElement, propKey, propValue, isCustomComponentTag);\n }\n }\n}\n\nfunction createElement(type, props, rootContainerElement, parentNamespace) {\n var isCustomComponentTag; // We create tags in the namespace of their parent container, except HTML\n // tags get no namespace.\n\n var ownerDocument = getOwnerDocumentFromRootContainer(rootContainerElement);\n var domElement;\n var namespaceURI = parentNamespace;\n\n if (namespaceURI === HTML_NAMESPACE) {\n namespaceURI = getIntrinsicNamespace(type);\n }\n\n if (namespaceURI === HTML_NAMESPACE) {\n {\n isCustomComponentTag = isCustomComponent(type, props); // Should this check be gated by parent namespace? Not sure we want to\n // allow or .\n\n !(isCustomComponentTag || type === type.toLowerCase()) ? warning$1(false, '<%s /> is using incorrect casing. ' + 'Use PascalCase for React components, ' + 'or lowercase for HTML elements.', type) : void 0;\n }\n\n if (type === 'script') {\n // Create the script via .innerHTML so its \"parser-inserted\" flag is\n // set to true and it does not execute\n var div = ownerDocument.createElement('div');\n\n {\n if (enableTrustedTypesIntegration && !didWarnScriptTags) {\n warning$1(false, 'Encountered a script tag while rendering React component. ' + 'Scripts inside React components are never executed when rendering ' + 'on the client. Consider using template tag instead ' + '(https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template).');\n didWarnScriptTags = true;\n }\n }\n\n div.innerHTML = '