ÿØÿà JFIF    ÿÛ „  ( %!1"%)+...383-7(-.+  -%%--------+------------/----------------------------ÿÀ  ¶" ÿÄ     ÿÄ @    !1AQaq‘¡"±ÁÑð2’BRráS‚ñ3b¢CT²Ò #cÿÄ    ÿÄ '   1!AQ2a"‘±#ÿÚ   ? ò(/p‘—–¢·,M|¯G»R£üešT. ôŸEoCFñ‡ 4ÔkåóxR|µÁ¨ÓDà!Ç´µ˜‡p ÍQ‹§!þž^õWsŒy  åÁ§$á«%ºq˜™JyyË0y«^Ϗ -3ÃÏËÈ£Æ\P’ä„s&•‹Üs üô'àWt¹pñCp$bÚF`·7.^)¾!)ÒÙ˜–ÅÏš^h¾ø³·ìe±ŒaeÖ—Í,e=B}Jéߦ$$½—šÙÜCC¯¶è8β–Åkèwx LÉngT±æ¹£Ócœ¿Í/©Éÿ ‰ÚCÒ­mq;Tt¶–}0"zÖPcd1š­¤tˆ„ÐÓâqú[™öUCŠ2޿د­É(¸ßúçšmW,Ò ºf‹Ån™ÄLêÁ8üÁkÁ€L¥ÍuJ1œôrÂSŒÓöt!7EUíïb)AËi¬â-ÙHk8òÁiXYwÅ)O^"ÇØriÛô{»wRUKÙÏÚlÓ¬€‚’שT ] ªb—ÊîKC^×M“xùäñz¬zJ× {4[¹M'IÆeH1LCWÕ]œûº WDæà°OÅ‚¹c²ÞuA–rL`HšpCez‡V’— Ž‚Ë„–ñ­'µR0ÕÖ=À:±G»C\nÆÉ5*¢ †3šhQ4ýÒi$Õ1"Ü]¢p-q3zcQ$ªö¨¥æf›‘»´ÝÚHá„e²JÇ–iÊ:·à¬Øc5Åk»Laª*wi [0Ówk ¦a¦0Õ²ÅÅ‚T¸’³q:Æ<¹ú Ò˜Æ}2VE•Ѐp¡Ô3Úº …h³^LJºçì¥Ánó|˜ÖˆÎˆ+« ¦dø‘Mº–d\ªDðÛ„Ì×LÝ——Ð9Ç|•FèçVm™¨€™3õS–9Äå¢<̉Ìm¢±`·º˜&Z²ž Ë®D«¶»6™‰©­HÈ Àá«h­i³04æ’hxœi3ï¨(ÓL·†‹¶ËpŒ ƒÜÒ? :õdsÀ –3æÓ·Üjâ¬9—]8n¼&]I F£¼…ì–—Œ0v°LǐÅfÛ2TÖ’aµ˜N@ÖBSÏ^à´4-±°b×nÈÈœÆD=KdŒø…ÄÈK,›ÖR§fjü$^ÔÎ!„6^ s:Üun\ôkCÞò÷<—Lúl Í›G¹ÀPá¼Nc¡šÒ…ÙWͳœ±vÊáЄ×9‹P‰cEØ‘™›µŸP<×g1 º©Ø¬wiÁ^l5× I/';Ë+´Z‡ÓÄFÕp[Èð’ HÄ ó 9¬Dl4“é±Ï”V=^Hð;žLädÉa‚°Ë,#/Ž~²BÔÛ QãñQtIeórVB,ÏÂf‹4#Μc‹É3ZIÖ Œ¢¥·üxa‡Ãçè„jŠ[5 Ä!U?,3žÎ×…ðdÓ÷háŠA‰ìÄ4÷ÃÜZÃE{‰®+W\ZÍE[‰»µk»MÝ­`¢©†˜ÃV‹-f¢¡†¢a«eŠ%«Y¨©q%jâd,Ôq`) ¤¦…šˆ ¦E>0Ùb²t–Ÿ  ÷jsςҒKÈcø(é›;k(’#ôŒQ ™C> õ³M9óºÆµ¤çâ;uÀ)5>RÔ¸fÓ~Ȧ—’-$fe«"FâUˆÊwµPÏu w+"åÉó¨6s™Û9(À¨ù©hE°½†n`m~“@©›p!Vkhµ Á1šbEqqÊ@ºèl›2 –Yã%‘‚hÛ{a¶‡ÅÞM²¬çL34®Çl]®‹ŽØŒm'RÜe35æöˆ­Á­ cP9šeÁköo´L³Ì=p8]”‡B¶,šº|ɏdzXˆØk*ÇÚ{#ñ‰pã(€¶‡9ý'šÜ³½¯kƒ†Â’ëSOƒ•Å®H6+a¢µˆ‹Y¨b˜b+XˆÖ!°u!¢"µˆˆn2ˆ Å0Ä`Å Ô®c(ÓÜGº•Ä»Œ âWî%q.áÐÄ÷î%umÍ£+ÜQ,Vn¦-GphU¸¢X­&,Gt ·K¢ÅÅ·¥RÄÊÉbKn N­R2g$VµÕó Qr#–ÓZUÏð0ÎtÙÀœz ëöo“Îk¯n„T°"SÞ+³/…€½"ižãO%Í%&Δâ‘ËØ´IˆÓ°Ë‰ÞM3.™yçÁzit›`4C`k¢¼á!álÄï sÂ[×!¤l¾æo"ƒIÔ'@ªu)3›ô®“@Z à¾] üœ'‡4¸PÞkÁ-qÄH‰ÓÍBd´ÿ —¹°ÄA&ÊUC„öz‚‚RæŠtf¬>˜ÑidšEçÑL÷áý¡V±h§­c¿¥¨ƒ@g¼…Ýö^ÞËc.ž„æ“I[ ª+·zÐÒÚ,½Ð»¶€C›7jk$๖€Ž¾ÅÙpp¶ÍþéΤ ½ØÎŒq ñpæžÅ¥#Øâ49ÃÂK^MYV“,¶Éz_òæ:…;Õ«¦I3âJ£¤û5$7Èxün\â]Êe¯(Ÿ&Ž‹¶2<6Ćf× æ¢ƱqWı[(ÙÂŽç‚T7¨@ÈÉÍß‚ïÙ"&3TYlGށ†)†#5ŠA©^T2ÆÁ†)©†©†¤yGXÁ†©"†)©¼ÅV WS†#©]R–r‹q5ÕbâWþBh¯u+ªÅÄ×ü„nÑ^êkªÁj‰jeœWˆÕÕ`µDµ2Ì+Ä µDµµ5Ô{¤Þ0RF’H÷AÛ<ÊÁ§ ƈæ0Ñ£ê4 öÚµ[¬/1²€â<-¬šö²r×0o×w ´xÐÒË„ g01¬„åEM蛇Ã\6µE›‘fÙO k÷CºnÓ1`iîÒ² áÂ!ÑLÄÿ ³¬\õ*:M=Ç»c‹2[‰ØsÕLò\ŒK L^™üÄN\¶#» Ç\……ßïIœÉ$¸ÎñÍ®ÔHÇ Ûí/´>Li”„†g^$ 7NÍÑÑ2M2ªNg=k½Ð}Ÿl6‡ —JWˆ”ÞéT·+µ¦üÂFè¢Vs6ýÆ4»2+2IÝ9ô9®ÇGÙÇ1+Ä8;*Õ§ž½D*îÑWÚçá3Ma¤·ˆ¥t}š²Ü…Q+Æüµ8HíS”üxGéÁˆ¦Ël„éÈ 5 µÄƒ6äÜ(kIš¯S†fÖ&¸®×v|Äyˆ*禌Éù@7-®Ä[]ÎÖ¿ê`º…=:…žJVnݳvðÖKE¼‚ »mà ÷f®:Ë ™–4rð¡4` ܹçž~‹C=œ…¾Ïj|VDtK.ƒ"9 Ï ­–éXá³6WÒïIL-Ї Ç PK\^GW8W8RTLCSS/RTLCSS.phpnu[tree = $tree; } protected function compare($what, $to, $ignoreCase) { if ($ignoreCase) { return strtolower($what) === strtolower($to); } return $what === $to; } protected function complement($value) { if ($value instanceof Size) { $value->setSize(100 - $value->getSize()); } else if ($value instanceof CSSFunction) { $arguments = implode($value->getListSeparator(), $value->getArguments()); $arguments = "100% - ($arguments)"; $value->setListComponents([$arguments]); } } public function flip() { $this->processBlock($this->tree); return $this->tree; } protected function negate($value) { if ($value instanceof ValueList) { foreach ($value->getListComponents() as $part) { $this->negate($part); } } else if ($value instanceof Size) { if ($value->getSize() != 0) { $value->setSize(-$value->getSize()); } } } protected function parseComments(array $comments) { $startRule = '^(\s|\*)*!?rtl:'; foreach ($comments as $comment) { $content = $comment->getComment(); if (preg_match('/' . $startRule . 'ignore/', $content)) { $this->shouldIgnore = 1; } else if (preg_match('/' . $startRule . 'begin:ignore/', $content)) { $this->shouldIgnore = true; } else if (preg_match('/' . $startRule . 'end:ignore/', $content)) { $this->shouldIgnore = false; } else if (preg_match('/' . $startRule . 'remove/', $content)) { $this->shouldRemove = 1; } else if (preg_match('/' . $startRule . 'begin:remove/', $content)) { $this->shouldRemove = true; } else if (preg_match('/' . $startRule . 'end:remove/', $content)) { $this->shouldRemove = false; } else if (preg_match('/' . $startRule . 'raw:/', $content)) { $this->shouldAddCss[] = preg_replace('/' . $startRule . 'raw:/', '', $content); } } } protected function processBackground(Rule $rule) { $value = $rule->getValue(); // TODO Fix upstream library as it does not parse this well, commas don't take precedence. // There can be multiple sets of properties per rule. $hasItems = false; $items = [$value]; if ($value instanceof RuleValueList && $value->getListSeparator() == ',') { $hasItems = true; $items = $value->getListComponents(); } // Foreach set. foreach ($items as $itemKey => $item) { // There can be multiple values in the same set. $hasValues = false; $parts = [$item]; if ($item instanceof RuleValueList) { $hasValues = true; $parts = $value->getListComponents(); } $requiresPositionalArgument = false; $hasPositionalArgument = false; foreach ($parts as $key => $part) { $part = $parts[$key]; if (!is_object($part)) { $flipped = $this->swapLeftRight($part); // Positional arguments can have a size following. $hasPositionalArgument = $parts[$key] != $flipped; $requiresPositionalArgument = true; $parts[$key] = $flipped; continue; } else if ($part instanceof CSSFunction && strpos($part->getName(), 'gradient') !== false) { // TODO Fix this. } else if ($part instanceof Size && ($part->getUnit() === '%' || !$part->getUnit())) { // Is this a value we're interested in? if (!$requiresPositionalArgument || $hasPositionalArgument) { $this->complement($part); $part->setUnit('%'); // We only need to change one value. break; } } $hasPositionalArgument = false; } if ($hasValues) { $item->setListComponents($parts); } else { $items[$itemKey] = $parts[$key]; } } if ($hasItems) { $value->setListComponents($items); } else { $rule->setValue($items[0]); } } protected function processBlock($block) { $contents = []; foreach ($block->getContents() as $node) { $this->parseComments($node->getComments()); if ($toAdd = $this->shouldAddCss()) { foreach ($toAdd as $add) { $parser = new Parser($add); $contents[] = $parser->parse(); } } if ($this->shouldRemoveNext()) { continue; } else if (!$this->shouldIgnoreNext()) { if ($node instanceof CSSList) { $this->processBlock($node); } if ($node instanceof RuleSet) { $this->processDeclaration($node); } } $contents[] = $node; } $block->setContents($contents); } protected function processDeclaration($node) { $rules = []; foreach ($node->getRules() as $key => $rule) { $this->parseComments($rule->getComments()); if ($toAdd = $this->shouldAddCss()) { foreach ($toAdd as $add) { $parser = new Parser('.wrapper{' . $add . '}'); $tree = $parser->parse(); $contents = $tree->getContents(); foreach ($contents[0]->getRules() as $newRule) { $rules[] = $newRule; } } } if ($this->shouldRemoveNext()) { continue; } else if (!$this->shouldIgnoreNext()) { $this->processRule($rule); } $rules[] = $rule; } $node->setRules($rules); } protected function processRule($rule) { $property = $rule->getRule(); $value = $rule->getValue(); if (preg_match('/direction$/im', $property)) { $rule->setValue($this->swapLtrRtl($value)); } else if (preg_match('/left/im', $property)) { $rule->setRule(str_replace('left', 'right', $property)); } else if (preg_match('/right/im', $property)) { $rule->setRule(str_replace('right', 'left', $property)); } else if (preg_match('/transition(-property)?$/i', $property)) { $rule->setValue($this->swapLeftRight($value)); } else if (preg_match('/float|clear|text-align/i', $property)) { $rule->setValue($this->swapLeftRight($value)); } else if (preg_match('/^(margin|padding|border-(color|style|width))$/i', $property)) { if ($value instanceof RuleValueList) { $values = $value->getListComponents(); $count = count($values); if ($count == 4) { $right = $values[3]; $values[3] = $values[1]; $values[1] = $right; } $value->setListComponents($values); } } else if (preg_match('/border-radius/i', $property)) { if ($value instanceof RuleValueList) { // Border radius can contain two lists separated by a slash. $groups = $value->getListComponents(); if ($value->getListSeparator() !== '/') { $groups = [$value]; } foreach ($groups as $group) { if ($group instanceof RuleValueList) { $values = $group->getListComponents(); switch (count($values)) { case 2: $group->setListComponents(array_reverse($values)); break; case 3: $group->setListComponents([$values[1], $values[0], $values[1], $values[2]]); break; case 4: $group->setListComponents([$values[1], $values[0], $values[3], $values[2]]); break; } } } } } else if (preg_match('/shadow/i', $property)) { // TODO Fix upstream, each shadow should be in a RuleValueList. if ($value instanceof RuleValueList) { // negate($value->getListComponents()[0]); } } else if (preg_match('/transform-origin/i', $property)) { $this->processTransformOrigin($rule); } else if (preg_match('/^(?!text\-).*?transform$/i', $property)) { // TODO Parse function parameters first. } else if (preg_match('/background(-position(-x)?|-image)?$/i', $property)) { $this->processBackground($rule); } else if (preg_match('/cursor/i', $property)) { $hasList = false; $parts = [$value]; if ($value instanceof RuleValueList) { $hastList = true; $parts = $value->getListComponents(); } foreach ($parts as $key => $part) { if (!is_object($part)) { $parts[$key] = preg_replace_callback('/\b(ne|nw|se|sw|nesw|nwse)-resize/', function($matches) { return str_replace($matches[1], str_replace(['e', 'w', '*'], ['*', 'e', 'w'], $matches[1]), $matches[0]); }, $part); } } if ($hasList) { $value->setListComponents($parts); } else { $rule->setValue($parts[0]); } } } protected function processTransformOrigin(Rule $rule) { $value = $rule->getValue(); $foundLeftOrRight = false; // Search for left or right. $parts = [$value]; if ($value instanceof RuleValueList) { $parts = $value->getListComponents(); $isInList = true; } foreach ($parts as $key => $part) { if (!is_object($part) && preg_match('/left|right/i', $part)) { $foundLeftOrRight = true; $parts[$key] = $this->swapLeftRight($part); } } if ($foundLeftOrRight) { // We need to reconstruct the value because left/right are not represented by an object. $list = new RuleValueList(' '); $list->setListComponents($parts); $rule->setValue($list); } else { $value = $parts[0]; // The first value may be referencing top or bottom (y instead of x). if (!is_object($value) && preg_match('/top|bottom/i', $value) && count($parts)>1) { $value = $parts[1]; } // Flip the value. if ($value instanceof Size) { if ($value->getSize() == 0) { $value->setSize(100); $value->setUnit('%'); } else if ($value->getUnit() === '%') { $this->complement($value); } } else if ($value instanceof CSSFunction && strpos($value->getName(), 'calc') !== false) { // TODO Fix upstream calc parsing. $this->complement($value); } } } protected function shouldAddCss() { if (!empty($this->shouldAddCss)) { $css = $this->shouldAddCss; $this->shouldAddCss = []; return $css; } return []; } protected function shouldIgnoreNext() { if ($this->shouldIgnore) { if (is_int($this->shouldIgnore)) { $this->shouldIgnore--; } return true; } return false; } protected function shouldRemoveNext() { if ($this->shouldRemove) { if (is_int($this->shouldRemove)) { $this->shouldRemove--; } return true; } return false; } protected function swap($value, $a, $b, $options = ['scope' => '*', 'ignoreCase' => true]) { $expr = preg_quote($a) . '|' . preg_quote($b); if (!empty($options['greedy'])) { $expr = '\\b(' . $expr . ')\\b'; } $flags = !empty($options['ignoreCase']) ? 'im' : 'm'; $expr = "/$expr/$flags"; return preg_replace_callback($expr, function($matches) use ($a, $b, $options) { return $this->compare($matches[0], $a, !empty($options['ignoreCase'])) ? $b : $a; }, $value); } protected function swapLeftRight($value) { return $this->swap($value, 'left', 'right'); } protected function swapLtrRtl($value) { return $this->swap($value, 'ltr', 'rtl'); } } PK\^GW8W8RTLCSS/RTLCSS.phpnu[PKQ8